facebookresearch / dinov2

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

grad error #383

Open zhou745 opened 8 months ago

zhou745 commented 8 months ago

Training with dinov2 as image encoder, nothing changed in dinov2

I receive the following error:

Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass /home/jqzhou/anaconda3/envs/gsp_gen/lib/python3.9/site-packages/torch/autograd/init.py:197: UserWarning: Grad strides do not match bucket view strides. This may indicate grad was not created according to the gradient layout contract, or that the param's strides changed since DDP was constructed. This is not an error, but may impair performance. grad.sizes() = [1, 1, 768], strides() = [1052160, 768, 1] bucket_view.sizes() = [1, 1, 768], strides() = [768, 768, 1] (Triggered internally at ../torch/csrc/distributed/c10d/reducer.cpp:325.) Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass /home/jqzhou/anaconda3/envs/gsp_gen/lib/python3.9/site-packages/torch/autograd/init.py:197: UserWarning: Grad strides do not match bucket view strides. This may indicate grad was not created according to the gradient layout contract, or that the param's strides changed since DDP was constructed. This is not an error, but may impair performance. grad.sizes() = [1, 1, 768], strides() = [1052160, 768, 1] bucket_view.sizes() = [1, 1, 768], strides() = [768, 768, 1] (Triggered internally at ../torch/csrc/distributed/c10d/reducer.cpp:325.) Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass