Harry-KIT / Image-Classification-on-small-datasets-in-Pytorch

This repo is special for those who want to start learning computer vision related tasks such as image classification.
36 stars 7 forks source link

Testing #4

Open kisa-misa opened 3 months ago

kisa-misa commented 3 months ago

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