question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'ResNet' object has no attribute 'module'

See original GitHub issue

Hi,

Could you please help with the following issue? I am trying to train a CSV dataset using a single GPU with the following packages versions:

  • Python = 3.6.0
  • Pytorch = 1.2.0

I had some previous error messages that I overcame by passing the environment variable CUDA_VISIBLE_DEVICES=0, I have 2 GPU but aren’t the same generation, and comment out the line retinanet = torch.nn.DataParallel(retinanet).cuda() .

The error that I am getting now is: File "/home/User/miniconda3/envs/pytorch-retinanet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 591, in __getattr__ type(self).__name__, name)) AttributeError: 'ResNet' object has no attribute 'module'

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rvandeghencommented, Feb 19, 2020

If you don’t use retinanet = torch.nn.DataParallel(retinanet).cuda() you should write retinanet.freeze_bn() instead of retinanet.module.freeze_bn(). Thus to solve all the issues, make sure that all your call with retinanet don’t use module. There is another .module that you have to remove in the csv_eval file as far as i remember

0reactions
kruthikakrcommented, Sep 21, 2021

Any help for this ? facing same issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'ResNet' object has no attribute 'module' · Issue #1
When I run python HHL.py -s duke -t market --logs-dir logs/duke2market-HHL, It occurs an error: Traceback (most recent call last):
Read more >
ResNet object has no attribute 'predict' - Stack Overflow
TLDR: I get an error called ModuleAttributeError that says the 'ResNet' module has no attribute 'predict'.
Read more >
AttributeError: 'ResNet' object has no attribute 'get_features'
Hello i defined a method inside a class but i don't know why i'm getting the following error AttributeError: 'ResNet' object has no...
Read more >
A brand new website interface for an even better experience!
Getting error "AttributeError: 'module' object has no attribute 'distribute'" when running resnet model in official folder.
Read more >
Transfer Learning tutorial - Bikash Santra
In the following, parameter scheduler is an LR scheduler object from ... name, value): AttributeError: 'ResNet' object has no attribute 'to'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found