Thank you for the quick fix! While testing it, I ran into some import issues.
The traceback below is common when I:
Launch Docker container tensorflow/tensorflow:2.2.0, then pip install tfjs-graph-converter==1.1.0.
Launch Docker container tensorflow/tensorflow:2.3.0, then pip install tfjs-graph-converter==1.1.0.
Launch Docker container python:3.8, then pip install tensorflow==2.3.0 tfjs-graph-converter==1.1.0.
Traceback (most recent call last):
File "/usr/local/bin/tfjs_graph_converter", line 5, in <module>
from tfjs_graph_converter.converter import pip_main
File "/usr/local/lib/python3.6/dist-packages/tfjs_graph_converter/__init__.py", line 4, in <module>
from tfjs_graph_converter import api # noqa: F401
File "/usr/local/lib/python3.6/dist-packages/tfjs_graph_converter/api.py", line 29, in <module>
from tfjs_graph_converter.optimization import optimize_graph
File "/usr/local/lib/python3.6/dist-packages/tfjs_graph_converter/optimization.py", line 19, in <module>
from tfjs_graph_converter.util import get_input_nodes, get_output_nodes
File "/usr/local/lib/python3.6/dist-packages/tfjs_graph_converter/util.py", line 13, in <module>
from tensorflow_core.core.protobuf.meta_graph_pb2 import SignatureDef
ModuleNotFoundError: No module named 'tensorflow_core'
This comment says that tensorflow_core only exists in 1.15, 2.0 and 2.1 so I gave it another try:
Launch Docker container tensorflow/tensorflow:2.1.0-py3, then pip install tfjs-graph-converter==1.1.0.
The tensorflow_core module was imported successfully but there was an issue importing AttrValue.
Traceback (most recent call last):
File "/usr/local/bin/tfjs_graph_converter", line 5, in <module>
from tfjs_graph_converter.converter import pip_main
File "/usr/local/lib/python3.6/dist-packages/tfjs_graph_converter/__init__.py", line 4, in <module>
from tfjs_graph_converter import api # noqa: F401
File "/usr/local/lib/python3.6/dist-packages/tfjs_graph_converter/api.py", line 29, in <module>
from tfjs_graph_converter.optimization import optimize_graph
File "/usr/local/lib/python3.6/dist-packages/tfjs_graph_converter/optimization.py", line 19, in <module>
from tfjs_graph_converter.util import get_input_nodes, get_output_nodes
File "/usr/local/lib/python3.6/dist-packages/tfjs_graph_converter/util.py", line 13, in <module>
from tensorflow_core.core.protobuf.meta_graph_pb2 import SignatureDef
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/__init__.py", line 46, in <module>
from . _api.v2 import compat
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/_api/v2/compat/__init__.py", line 39, in <module>
from . import v1
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/_api/v2/compat/v1/__init__.py", line 32, in <module>
from . import compat
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/_api/v2/compat/v1/compat/__init__.py", line 39, in <module>
from . import v1
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/_api/v2/compat/v1/compat/v1/__init__.py", line 82, in <module>
from tensorflow.python import AttrValue
ImportError: cannot import name 'AttrValue'
I suggest that if TensorFlow.js Graph Model Converter depends on TF==2.1.0 and doesn't support TF>2.1.0, the documentation should mention it.
I would like to ask if there is some other dependency needed to solve the AttrValue import error? Below is pip freeze of tensorflow/tensorflow:2.1.0-py3 and pip install tfjs-graph-converter==1.1.0:
Thank you for the quick fix! While testing it, I ran into some import issues.
The traceback below is common when I:
tensorflow/tensorflow:2.2.0
, thenpip install tfjs-graph-converter==1.1.0
.tensorflow/tensorflow:2.3.0
, thenpip install tfjs-graph-converter==1.1.0
.python:3.8
, thenpip install tensorflow==2.3.0 tfjs-graph-converter==1.1.0
.This comment says that
tensorflow_core
only exists in 1.15, 2.0 and 2.1 so I gave it another try:tensorflow/tensorflow:2.1.0-py3
, thenpip install tfjs-graph-converter==1.1.0
.The
tensorflow_core
module was imported successfully but there was an issue importingAttrValue
.AttrValue
import error? Below ispip freeze
oftensorflow/tensorflow:2.1.0-py3
andpip install tfjs-graph-converter==1.1.0
:Originally posted by @glenvorel in https://github.com/patlevin/tfjs-to-tf/issues/13#issuecomment-665586803