thuml / Transfer-Learning-Library

Transfer Learning Library for Domain Adaptation, Task Adaptation, and Domain Generalization
http://transfer.thuml.ai
MIT License
3.39k stars 553 forks source link

'ResNet' object has no attribute 'out_features' #251

Open purnavindhya opened 11 months ago

purnavindhya commented 11 months ago

Describe the bug raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'") AttributeError: 'ResNet' object has no attribute 'out_features'

To Reproduce Steps to reproduce the behavior:

  1. Go to python3 dann.py data/office31 -d Office31 -s A -t W -a resnet50 --epochs 20

Screenshots If applicable, add screenshots to help explain your problem.

Screenshot 2023-10-31 at 2 16 11 PM

Desktop (please complete the following information):

thucbx99 commented 4 months ago

I think this is because PyTorch updates this implementation of ResNet in higher versions such as 2.1.0. Try using PyTorch 1.8 or 1.9 may help.