C-Tran icon indicating copy to clipboard operation
C-Tran copied to clipboard

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

Open ans92 opened this issue 2 years ago • 7 comments

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?

ans92 avatar Feb 04 '23 11:02 ans92

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

jacklanchantin avatar Feb 07 '23 21:02 jacklanchantin

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

ans92 avatar Feb 15 '23 05:02 ans92

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

jacklanchantin avatar Feb 15 '23 06:02 jacklanchantin

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.

ans92 avatar Feb 15 '23 08:02 ans92

Can you try running without a GPU?

On Wed, Feb 15, 2023 at 3:30 AM ans92 @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/QData/C-Tran/issues/20#issuecomment-1430935491, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJFX7GCIUVFG6VCOIHTVQ3WXSHZPANCNFSM6AAAAAAURD35DI . You are receiving this because you commented.Message ID: @.***>

jacklanchantin avatar Feb 15 '23 15:02 jacklanchantin

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?

ans92 avatar Feb 16 '23 05:02 ans92

It could be. I can't replicate the error

jacklanchantin avatar Feb 16 '23 16:02 jacklanchantin