jankrepl / mildlyoverfitted

Paper implementations from scratch and machine learning tutorials
MIT License
337 stars 125 forks source link

Information about DINO in PyTorch #5

Closed checho9214 closed 8 months ago

checho9214 commented 2 years ago

Good morning Mr Jan Krepl,

Cordial greeting,

After running DINO in PyTorch (https://www.youtube.com/ watch? V = psmMEWKk4Uk & list = PLDW9q3PQf5VI0X5ozC3dDgbld8S4lrBuL & index = 15) in google colab because I don't have a GPU, and I'm decreasing the amount of images for training and try, but I get the following error:

  1. The first error found was in the file "train.py" I had to modify

    Parameters: vit_name, dim = "vit_deit_small_patch16_224", 384 by # Parameters: vit_name, dim = "vit_small_patch16_224", 384, it wouldn't let me run the file.

  2. Then I ran "python train.py" and I got this error: AttributeError: module 'tensorflow._api.v2.io.gfile' has no attribute 'get_filesystem'. I was reading in this link a possible solution (https://stackoverflow.com/questions/60730544/tensorboard-colab-tensorflow-api-v1-io-gfile-has-no-attribute-get-filesystem), where I removed tensorflow and apparently, it was working for me but I got this message again:

{'batch_size': 32, 'device': 'cpu', 'logging_freq': 1000, 'momentum_teacher': 0.9995, 'n_crops': 4,' n_epochs': 200, 'out_dim': 1024, 'tensorboard_dir': ' logs', 'clip_grad': 2.0, 'norm_last_layer': True, 'batch_size_eval': 64, 'teacher_temp': 0.04, 'student_temp': 0.1, 'pretrained': False, 'weight_decay': 0.4} /usr/local/lib/python3.7/dist-packages/torchvision/transforms/transforms.py:853: UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum. "Argument interpolation should be of type InterpolationMode instead of int." /usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py:481: UserWarning: This DataLoader will create 4 worker processes in total. Our suggested max number of worker in current system is 2, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness / freeze if necessary. cpuset_checked)) 0% 0/8 [00:00 <?,? It / s] ^ C

I would appreciate a lot if you could help me, I have not been able to run the model. Thanks a lot.

jankrepl commented 2 years ago

Thank you for your interest!

1)

Nice find! It is because of the timm package. I can confirm that I have the same issue with timm-0.4.12. It is a direct consequence of this PR https://github.com/rwightman/pytorch-image-models/pull/702/files where a bulk renaming took place. The new name of the model I used in the video is deit_small_patch16_224.

2)

If I am not mistaken it is "just" a warning (the script doesn't stop execution), right?

I hope that helps, let me know if you have any other questions!

jankrepl commented 8 months ago

I am closing this due to inactivity. If you still have any issues feel free to comment and I can reopen:)