Closed joel-huang closed 5 years ago
Hi, tried unpickling from Python 2 to Python 3 as below, and it works:
from functools import partial import pickle pickle.load = partial(pickle.load, encoding="latin1") pickle.Unpickler = partial(pickle.Unpickler, encoding="latin1") def main(): opt = opts().parse() if opt.loadModel != 'none': model = torch.load(opt.loadModel).cuda() else: model = torch.load('hgreg-3d.pth', map_location=lambda storage, loc: storage, pickle_module=pickle).cuda() ...
After this, I'm not getting any luck with the provided model with PyTorch 0.4.0 and 0.4.1:
AttributeError: 'BatchNorm2d' object has no attribute 'track_running_stats'
and even after downgrading to 0.1.12:
AttributeError: Can't get attribute 'Upsample' on <module 'torch.nn.modules.upsampling' ...
What's the exact version of PyTorch that I should be working with? Thanks.
For anyone wondering, 0.3.0 works
Hi, tried unpickling from Python 2 to Python 3 as below, and it works:
After this, I'm not getting any luck with the provided model with PyTorch 0.4.0 and 0.4.1:
and even after downgrading to 0.1.12:
What's the exact version of PyTorch that I should be working with? Thanks.