tensorflow-onnx
tensorflow-onnx copied to clipboard
AttributeError: 'FuncGraph'
Hi,
I am using the below command to convert a tf-nlp model to onnx. It has a custom-ops built in.
!/anaconda/envs/onnxet/bin/python3.10 -m tf2onnx.convert --saved-model {checkpoint_path} --output {onnx_model_output_path} --extra_opset ai.onnx.contrib:1 --custom-ops StringStrip:ai.onnx.contrib
The code has been working fine with no issue, but for some reason, not anymore. Here is the error I get:
Execute tf2onnx.convert from saved model ./01_nlprrs_pg_01_NoGmail_tf/ to output nlprrs_pg_NoTop20.onnx
/anaconda/envs/onnxet/lib/python3.10/runpy.py:126: RuntimeWarning: 'tf2onnx.convert' found in sys.modules after import of package 'tf2onnx', but prior to execution of 'tf2onnx.convert'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
2023-09-14 05:38:25,073 - WARNING - '--tag' not specified for saved_model. Using --tag serve
2023-09-14 05:38:25,996 - INFO - Signatures found in model: [serving_default].
2023-09-14 05:38:25,997 - WARNING - '--signature_def' not specified, using first signature: serving_default
Traceback (most recent call last):
File "/anaconda/envs/onnxet/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/anaconda/envs/onnxet/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/anaconda/envs/onnxet/lib/python3.10/site-packages/tf2onnx/convert.py", line 706, in
I would appreciate any advice. Mo
Could you please try the latest tf2onnx version? This is an issue brought by recent TensorFlow versions and was fixed already.