SHI-Labs / Compact-Transformers

Escaping the Big Data Paradigm with Compact Transformers, 2021 (Train your Vision Transformers in 30 mins on CIFAR-10 with a single GPU!)
https://arxiv.org/abs/2104.05704
Apache License 2.0
495 stars 77 forks source link

Adding evaluation feature #36

Closed alibalapour closed 2 years ago

alibalapour commented 2 years ago

I had some problems with evaluating a custom test dataset on my fine-tuned model. So, I changed the train.py a little bit and added --evaluate argument to the parser. With this code, you can evaluate the test dataset: python train.py --model cct_7_3x1_32 /path/to/test_dataset --resume /path/to/finetuned_model --evaluate

Also, when the task is classification with less than 5 classes, the validataion() function didn't work. So I fixed it with 21ac290 and 6b417f5 commits.