Skip to content

Commit baf8cf4

Browse files
make dino optional in vit
1 parent 6cf0b5b commit baf8cf4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cellpose/vit.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
from pathlib import Path
99
torch.backends.cuda.matmul.allow_tf32 = True
1010

11+
import logging
12+
13+
vit_logger = logging.getLogger(__name__)
14+
1115
try:
1216
from dinov3.hub.backbones import dinov3_vitl16, dinov3_vitb16
13-
except ImportError:
14-
raise ImportError("dinov3 is required for CPDINO. Install with 'pip install cellpose[dino]'.")
17+
except:
18+
vit_logger.warning("Could not import CPDINO, run `pip install cellpose[dino]` to use CPDINO model")
1519

1620

1721
class BaseModel(nn.Module):

0 commit comments

Comments
 (0)