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

AttributeError: 'DataParallel' object has no attribute 'grow_network' #60

Open
aminmiri opened this issue Sep 13, 2020 · 2 comments
Open

Comments

@aminmiri
Copy link

When I run the model using only 100 images for testing I got this error :

Traceback (most recent call last): File "trainer.py", line 380, in <module> trainer.train() File "trainer.py", line 261, in train self.resl_scheduler() File "trainer.py", line 157, in resl_scheduler self.G.grow_network(floor(self.resl)) File "/home/miri/anaconda3/envs/mirilab/lib/python3.7/site-packages/torch/nn/modules/module.py", line 576, in __getattr__ type(self).__name__, name)) AttributeError: 'DataParallel' object has no attribute 'grow_network'

@ningmomomomomo
Copy link

I met the same error
change self.G.grow_network into self.G.module.grow_network
then it fixed
however I'm not sure it's the right way to change, semantically

@woshichunge12
Copy link

@ningmomomomomo @aminmiri
May I ask if you encountered other errors in subsequent training?
like this after you mentioned:
self.fadein['gen'] = dict(self.G.model.named_children())['fadein_block']
self.fadein['dis'] = dict(self.D.model.named_children())['fadein_block']
AttributeError:DataParallel not has attributes model

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

3 participants