xingyizhou / pytorch-pose-hg-3d

PyTorch implementation for 3D human pose estimation
GNU General Public License v3.0
613 stars 143 forks source link

PyTorch version #34

Closed joel-huang closed 5 years ago

joel-huang commented 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.

joel-huang commented 5 years ago

For anyone wondering, 0.3.0 works