Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'CTranModel' object has no attribute 'module'. Did you mean: 'modules'? #20

Open
ans92 opened this issue Feb 4, 2023 · 7 comments
Open

Comments

@ans92
Copy link

ans92 commented Feb 4, 2023

Hi,
I want to run the model by freezing the backbone I am getting the following error in main.py line 56:
'CTranModel' object has no attribute 'module'. Did you mean: 'modules'?

When I change module to modules then I get following error on same line 56 in main.py:
AttributeError: 'function' object has no attribute 'backbone'

Could you please help me regarding this?

@jacklanchantin
Copy link
Collaborator

Can you share the command line you are using? Are you using GPUs?

@ans92
Copy link
Author

ans92 commented Feb 15, 2023

Thank you for your reply
Yes I am using GPU. I am using following command line:

python3 "/home/ans/CZSL/C-Tran-main/main.py"  --batch_size 7  --lr 0.00001 --optim 'adam' --layers 3  --dataset 'mit_states' --grad_ac_step 2 --dataroot data/ --epochs 100 --freeze_backbone

@jacklanchantin
Copy link
Collaborator

And were you able to run the commands in the README?

@ans92
Copy link
Author

ans92 commented Feb 15, 2023

Yes I were able to download and run the model on voc20 dataset. Even I am able to run the model on new dataset when I also update the image extractor. However, if I keep the image extractor fixed through --freeze_backbone parameter then this error occurs.

@jacklanchantin
Copy link
Collaborator

jacklanchantin commented Feb 15, 2023 via email

@ans92
Copy link
Author

ans92 commented Feb 16, 2023

Yes I have run the model with cpu but error still exists.
My torch version is different than listed in requirements.txt file
I have 1.13.0+cu117 (torch) and 0.14.0+cu117 (torchvision)

Do you think it is causing this problem?

@jacklanchantin
Copy link
Collaborator

It could be. I can't replicate the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants