paddle模型转换为onnx模型后,再将onnx模型转换回paddle模型报错
Created by: libingbingdev
使用x2paddle命令将paddle模型(mobilenet_v2_imagenet)转换为onnx模型,然后再使用命令转化回来时会报错:
D:\Git>x2paddle --framework=onnx --model=test_onnx/mobilenet_v2/x2paddle_model.onnx --save_dir=test paddle.version = 1.8.0 Now translating model from onnx to paddle. model ir_version: 6, op version: 11 Traceback (most recent call last): File "D:\Anaconda3\anaconda3\lib\site-packages\x2paddle-0.7.2-py3.7.egg\x2paddle\decoder\onnx_decoder.py", line 498, in check_model_running_state ipt.shape).astype(datatype) File "mtrand.pyx", line 430, in numpy.random.mtrand.RandomState.random File "mtrand.pyx", line 421, in numpy.random.mtrand.RandomState.random_sample File "_common.pyx", line 256, in numpy.random._common.double_fill TypeError: 'NoneType' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "D:\Anaconda3\anaconda3\Scripts\x2paddle-script.py", line 11, in load_entry_point('x2paddle==0.7.2', 'console_scripts', 'x2paddle')() File "D:\Anaconda3\anaconda3\lib\site-packages\x2paddle-0.7.2-py3.7.egg\x2paddle\convert.py", line 268, in main onnx2paddle(args.model, args.save_dir, params_merge) File "D:\Anaconda3\anaconda3\lib\site-packages\x2paddle-0.7.2-py3.7.egg\x2paddle\convert.py", line 181, in onnx2paddle model = ONNXDecoder(model_path) File "D:\Anaconda3\anaconda3\lib\site-packages\x2paddle-0.7.2-py3.7.egg\x2paddle\decoder\onnx_decoder.py", line 325, in init self.check_model_running_state(onnx_model) File "D:\Anaconda3\anaconda3\lib\site-packages\x2paddle-0.7.2-py3.7.egg\x2paddle\decoder\onnx_decoder.py", line 503, in check_model_running_state "onnxruntime inference onnx model failed, Please confirm the correctness of onnx model by onnxruntime, if onnx model is correct, please submit issue in github." Exception: onnxruntime inference onnx model failed, Please confirm the correctness of onnx model by onnxruntime, if onnx model is correct, please submit issue in github.