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

print 语法错误 #41

Open
ZhanWei-redstone opened this issue Mar 15, 2019 · 0 comments
Open

print 语法错误 #41

ZhanWei-redstone opened this issue Mar 15, 2019 · 0 comments

Comments

@ZhanWei-redstone
Copy link

ZhanWei-redstone commented Mar 15, 2019

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')

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

1 participant