Image-Classification-on-small-datasets-in-Pytorch icon indicating copy to clipboard operation
Image-Classification-on-small-datasets-in-Pytorch copied to clipboard

Testing

Open kisa-misa opened this issue 8 months ago • 0 comments

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

kisa-misa avatar Jun 11 '24 12:06 kisa-misa