Closed ak9250 closed 5 years ago
I've updated requirement.txt
, please check it.
I have installed required libraries from the updated requirement.txt, but still I'm getting the error AttributeError: module 'torch.nn' has no attribute 'ModuleDict'
@Anjali-Poornima666 Could you please paste the error message here?
class IntermediateLayerGetter(nn.ModuleDict):
AttributeError: module 'torch.nn' has no attribute 'ModuleDict'
On Thu, Jul 4, 2019 at 5:57 PM Yifan Jiang notifications@github.com wrote:
@Anjali-Poornima666 https://github.com/Anjali-Poornima666 Could you please paste the error message here?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yueruchen/EnlightenGAN/issues/10?email_source=notifications&email_token=AHLBME4EYFCBEGMVDWZ5WJTP5XUBJA5CNFSM4H4VHKWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZHI3BI#issuecomment-508464517, or mute the thread https://github.com/notifications/unsubscribe-auth/AHLBMEYXDJTZNRX2EFBWRYTP5XUBJANCNFSM4H4VHKWA .
@Anjali-Poornima666 Could you give a more specific file name and line number?
File
"/home/administrator/users/interns/anjali/EnlightenGAN/data/unaligned_dataset.py",
line 4, in
This is the entire error:
CustomDatasetDataLoader
Traceback (most recent call last):
File "predict.py", line 16, in
On Thu, Jul 4, 2019 at 6:14 PM Yifan Jiang notifications@github.com wrote:
@Anjali-Poornima666 https://github.com/Anjali-Poornima666 Could you give a more specific file name and line number?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yueruchen/EnlightenGAN/issues/10?email_source=notifications&email_token=AHLBME5WWIPWW2TD3RY2I53P5XWDZA5CNFSM4H4VHKWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZHKEGI#issuecomment-508469785, or mute the thread https://github.com/notifications/unsubscribe-auth/AHLBME5TFFRJ5MO4NZBVBELP5XWDZANCNFSM4H4VHKWA .
@Anjali-Poornima666
I can not reproduce the bug here, if you still meet this problem, I suggest you use pytorch==0.4.1 instead. And you should change the loss.data[0]
to loss.item()
.
I'll try with torch 0.4.1 Could you please specify where I should make that change?
On Fri, Jul 5, 2019 at 3:59 PM Yifan Jiang notifications@github.com wrote:
@Anjali-Poornima666 https://github.com/Anjali-Poornima666 I can not reproduce the bug here, if you still meet this problem, I suggest you use pytorch==0.4.1 instead. And you should change the loss.data[0] to loss.item().
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yueruchen/EnlightenGAN/issues/10?email_source=notifications&email_token=AHLBME44PBMTJFDCAQVNGMLP54PATA5CNFSM4H4VHKWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZJFVHY#issuecomment-508713631, or mute the thread https://github.com/notifications/unsubscribe-auth/AHLBME5T434JEBKBM4NNC4LP54PATANCNFSM4H4VHKWA .
You may consider to look at this page https://pytorch.org/blog/pytorch-0_4_0-migration-guide/
Same error with:
pip freeze | grep torch
torch==0.3.1
torchfile==0.1.0
torchvision==0.3.0
Error is gone with:
pip freeze | grep torch
torch==0.4.1
torchfile==0.1.0
torchvision==0.2.0
according to this, requirements should be torch==0.4.1? https://discuss.pytorch.org/t/can-some-one-give-me-a-working-example-of-nn-moduledict/22447/2