facebookresearch / dinov2

PyTorch code and models for the DINOv2 self-supervised learning method.
Apache License 2.0
8.3k stars 699 forks source link

Issue regarding DinoVisionTransformer #391

Open sima111b opened 3 months ago

sima111b commented 3 months ago

Hi,

I am trying to run the training code "python dinov2/run/train/train.py \ --nodes 4 \ --config-file dinov2/configs/train/vitl16_short.yaml \ --output-dir <PATH/TO/OUTPUT/DIR> \ train.dataset_path=ImageNet:split=TRAIN:root=<PATH/TO/DATASET>:extra=<PATH/TO/DATASET>"

but face to this error: AttributeError: "DinoVisionTransformer' has no attribute '_streams'.

Could you please advise me regarding it? Thanks!

MichaelDoron commented 1 month ago

I have the same issue, is there a solution for this?

MrPeterJin commented 4 weeks ago

Same problem here, any solution?

joreeves commented 3 weeks ago

I was getting the same error. Here is what fixed it for me:

Environment: Ubuntu (WSL)

First, I was using python 3.11, I cleared conda and started fresh with 3.10

If you have cuda 117 then you can likely skip the next steps and jump to the install:

Next, I modified requirements file to use my correct cuda version. (cu117 -> cu121)

This creates a dependency error for torchvision 0.15 since it relies on torch+cu117. So i removed the version dependency for torchvision.

This is what my requirements looked like.

--extra-index-url https://download.pytorch.org/whl/cu121
torch==2.0.0
torchvision
omegaconf
torchmetrics==0.10.3
fvcore
iopath
xformers==0.0.18
submitit
--extra-index-url https://pypi.nvidia.com
cuml-cu11

Then installed the requirements with pip install -r requirements.txt and everything worked as it should.