pytorch2keras
pytorch2keras copied to clipboard
cannot import name 'optimizer' from 'onnx'
Describe the bug While running
import pytorch2keras
k_model = pytorch2keras (model_pt, input_var, [(3, 32, 32,)], verbose=True, names='short')
I am getting the following error:
I am using ubuntu20.04, onnx-1.10.2 pytorch2keras-0.2.4
You have to uninstall current version of onnx and reinstall 1.8.1 version, because the optimizer is not further supported from this version on. This worked for me.
dupe of #132
I got the same error when installing pytorch2keras
from PyPI. The version available on PyPI is outdated. A fix was merged on master (and not yet available on PyPI). I got it working by pip installing the package directly from GitHub.
@bourcierj i was able to fix the issue as well by simply installing from the github repo rather then directly installing from pypl
@HksH143 @bourcierj 请问一下有这个github pip安装包? 为什么我找不到 在哪?