-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
has workaroundhigh prioritymodule: nnRelated to torch.nnRelated to torch.nntriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
Loading a model created with pytorch 1.0 fails on pytorch 1.1 with the error "AttributeError: 'Conv2d' object has no attribute 'padding_mode'".
This issue was also reported on jacquelinelala/GFN#11 .
complete backtrace:
Traceback (most recent call last):
File "run_nn.py", line 213, in <module>
loss = criterion(model(batch_y)[:,:,loss_crop_lb:loss_crop_up, loss_crop_lb:loss_crop_up], batch_x[:,:,loss_cro
p_lb:loss_crop_up, loss_crop_lb:loss_crop_up]).cuda()
File "/usr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
result = self.forward(*input, **kwargs)
File "/orb/Dev/mthesis-denoise/networks/Hul.py", line 511, in forward
l126 = self.enc128to126std(x)
File "/usr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
result = self.forward(*input, **kwargs)
File "/usr/lib/python3.7/site-packages/torch/nn/modules/container.py", line 92, in forward
input = module(input)
File "/usr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
result = self.forward(*input, **kwargs)
File "/usr/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 331, in forward
if self.padding_mode == 'circular':
File "/usr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 539, in __getattr__
type(self).__name__, name))
AttributeError: 'Conv2d' object has no attribute 'padding_mode'
Example of problematic model: https://github.com/trougnouf/mthesis-denoise/blob/master/networks/Hul.py , loaded with model = torch.load(args.load_g_path, map_location=device)
A workaround is to comment out the lines that use self.padding_mode in module.py, the model can then be imported, and saving the state_dictionary instead of the whole model allows loading into an unmodified version of pytorch 1.1.
jeremycochoy, amnezzia, Diyago, pratyushmaini and IvonaTau
Metadata
Metadata
Assignees
Labels
has workaroundhigh prioritymodule: nnRelated to torch.nnRelated to torch.nntriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module