starimeL/PytorchConverter

print 语法错误

Opened this issue · 0 comments

run.py 第95行:

if model_path != '':
        try:
            pytorch_net.load_state_dict(torch.load(model_path, map_location=lambda storage, loc: storage))
        except AttributeError:
            pytorch_net = torch.load(model_path, map_location=lambda storage, loc: storage)
    else:
        NetName = str(pytorch_net.__class__.__name__)
        if not os.path.exists(ModelDir + NetName):
            os.makedirs(ModelDir + NetName)
        print 'Saving default weight initialization...'
        torch.save(pytorch_net.state_dict(), ModelDir + NetName + '/' + NetName + '.pth')

    """ Replace denormal weight values(<1e-30), otherwise may increase forward time cost """
    ReplaceDenormals(pytorch_net)

    """  Connnnnnnnvert!  """
    print('Converting...')

在python3中,不应该使用print 'str',只能用print('str')