Image-Classification-on-small-datasets-in-Pytorch
Image-Classification-on-small-datasets-in-Pytorch copied to clipboard
Testing
Hi! I can't test my trained models (i tried vgg, vit and swin). The error i encountered:
Traceback (most recent call last):
File "/home/user/w/Image-Classification-on-small-datasets-in-Pytorch/test.py", line 24, in <module>
num_ftrs = model.fc.in_features
File "/home/user/anaconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1688, in __getattr__
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'VGG' object has no attribute 'fc'
Could you please provide testing code for all the models? Everything works fine with shufflenet