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

self.cache[n] = getattr(self, n)(*[self.cache[x] for x in i]),run it python3.5,it make a mistake. #5

Open
Clarence-wen opened this issue Mar 27, 2019 · 1 comment

Comments

@Clarence-wen
Copy link

File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(input, **kwargs)
File "/home/clarence/cifar10-fast/torch_backend.py", line 126, in forward
self.cache[n] = getattr(self, n)(
[self.cache[x] for x in i])
File "/home/clarence/cifar10-fast/torch_backend.py", line 126, in
self.cache[n] = getattr(self, n)(*[self.cache[x] for x in i])
KeyError: 'classifier'

@lioujheyu
Copy link

I had the same issue and found this is caused by the implementation change of dict between python 3.5 and 3.6.

What I did to solve this problem is to replace all dict and {} with OrderedDict in python 3.5.

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