I have a new env in conda and if I run the following command after activating the env, it will be successful:
python -c "import tf2onnx"
But, if I run the same command (after activating the env) with Jupyter notebook, I got the following error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-9d842ab860c9> in <module>
----> 1 import tf2onnx
C:\Miniconda3\envs\tf\lib\site-packages\keras2onnx\ktf2onnx\tf2onnx\__init__.py in <module>
11 from .version import version as __version__
12 from . import logging
---> 13 from tf2onnx import tfonnx, utils, graph, graph_matcher, shape_inference, schemas # pylint: disable=wrong-import-order
C:\Miniconda3\envs\tf\lib\site-packages\keras2onnx\ktf2onnx\tf2onnx\tfonnx.py in <module>
23 import tf2onnx.onnx_opset # pylint: disable=unused-import
24 import tf2onnx.custom_opsets # pylint: disable=unused-import
---> 25 from tf2onnx.graph import Graph
26 from tf2onnx.graph_matcher import OpTypePattern, GraphMatcher
27 from tf2onnx.rewriter import * # pylint: disable=wildcard-import
C:\Miniconda3\envs\tf\lib\site-packages\keras2onnx\ktf2onnx\tf2onnx\graph.py in <module>
19
20 from distutils.version import StrictVersion
---> 21 from onnx import helper, numpy_helper, shape_inference, OperatorSetIdProto, AttributeProto, version
22 from tf2onnx import utils, __version__
23 from tf2onnx.utils import port_name, find_opset
ImportError: cannot import name 'shape_inference'
What is the difference between running this command with or without jupyter that causes this error?
Thanks in advance