ShivamRajSharma / Vision-Transformer

Pytorch implementation of ViT on CIFAR-10.
16 stars 5 forks source link

Inconsistent name 'ViT' and Missing file 'transformers' #2

Open sptom opened 2 years ago

sptom commented 2 years ago

Hi there!

Thanks for this repository The code doesn't run though... Two issues that I found:

  1. The model name in the file is ViT, while in the training file it's called as "ImageTransformer.ImageTransformer". But that's find, I changed it to "ImageTransformer.ViT". The patch size wasn't provided in the training file, but I put it in by adding patch_hight=config.patch_size, patch_width=config.patch_size.

  2. There isn't a file named "transformers" in the repository, but the train.py file does use it to create the scheduler with warmup. I tried t construct a warmup scheduler using pytorch ignite, but I'm not sure if it's consistent with your implementation. Please add transformers.py. (Please see image attached)

image

Thanks!

kongweiming commented 2 years ago

i have the same issue,and i also found the model.bin is not match the model arch

Mustafa00124 commented 6 months ago

I think the missing transformers file is actually a library from hugging face. you might need to install it using pip. the vit naming is inconsistent though. I just used the instantiation from the imagetransformer file in the train file