Open3

tensorflow v2.17.0以降の環境で tensorflowjs_converter が動かない

PINTOPINTO
pip show tensorflow
Name: tensorflow
Version: 2.17.0

tensorflowjs_converter \
--input_format tf_saved_model \
--output_format tfjs_graph_model \
saved_model \
tfjs_model

tensorflow.python.framework.errors_impl.NotFoundError: /home/xxxx/.local/lib/python3.10/site-packages/tensorflow_decision_forests/tensorflow/ops/inference/inference.so: undefined symbol: _ZN10tensorflow15TensorShapeBaseINS_11TensorShapeEEC1EN4absl12lts_202301254SpanIKlEE
pip install -U tensorflowjs --no-deps

tensorflowjs_converter \
--input_format tf_saved_model \
--output_format tfjs_graph_model \
saved_model \
tfjs_model

tensorflow.python.framework.errors_impl.NotFoundError: /home/xxxx/.local/lib/python3.10/site-packages/tensorflow_decision_forests/tensorflow/ops/inference/inference.so: undefined symbol: _ZN10tensorflow15TensorShapeBaseINS_11TensorShapeEEC1EN4absl12lts_202301254SpanIKlEE
pip install tensorflow_decision_forests -U --no-deps
tensorflowjs_converter \
--input_format tf_saved_model \
--output_format tfjs_graph_model \
saved_model \
tfjs_model

ModuleNotFoundError: No module named 'yggdrasil_decision_forests'
pip install ydf -U --no-deps

tensorflowjs_converter \
--input_format tf_saved_model \
--output_format tfjs_graph_model \
saved_model \
tfjs_model

ImportError: cannot import name 'estimator' from 'tensorflow.compat.v1'
pip install -U tensorflow_hub --no-deps

tensorflowjs_converter \
--input_format tf_saved_model \
--output_format tfjs_graph_model \
saved_model \
tfjs_model
PINTOPINTO

まとめ

pip install -U --no-deps \
tensorflowjs \
tensorflow_decision_forests \
ydf \
tensorflow_hub
pip show \
tensorflowjs \
tensorflow_decision_forests \
ydf \
tensorflow_hub

Name: tensorflowjs
Version: 4.22.0
Summary: 
Home-page: https://js.tensorflow.org/
Author: Google LLC
Author-email: opensource@google.com
License: Apache 2.0
Requires: flax, importlib_resources, jax, jaxlib, packaging, six, tensorflow, tensorflow-decision-forests, tensorflow-hub, tf-keras
Required-by: tfjs-graph-converter
---
Name: tensorflow_decision_forests
Version: 1.10.0
Summary: Collection of training and inference decision forest algorithms.
Home-page: https://github.com/tensorflow/decision-forests
Author: Google Inc.
Author-email: decision-forests-contact@google.com
License: Apache 2.0
Requires: absl-py, numpy, pandas, six, tensorflow, tf-keras, wheel, wurlitzer, ydf
Required-by: tensorflowjs
---
Name: ydf
Version: 0.8.0
Summary: YDF (short for Yggdrasil Decision Forests) is a library for training, serving, evaluating and analyzing decision forest models such as Random Forest and Gradient Boosted Trees.
Home-page: https://github.com/google/yggdrasil-decision-forests
Author: Mathieu Guillame-Bert, Richard Stotz, Jan Pfeifer
Author-email: decision-forests-contact@google.com
License: Apache 2.0
Requires: absl-py, numpy, protobuf
Required-by: tensorflow_decision_forests
---
Name: tensorflow-hub
Version: 0.16.1
Summary: TensorFlow Hub is a library to foster the publication, discovery, and consumption of reusable parts of machine learning models.
Home-page: https://github.com/tensorflow/hub
Author: Google LLC
Author-email: packages@tensorflow.org
License: Apache 2.0
Requires: numpy, protobuf, tf-keras
Required-by: tensorflowjs