profile
viewpoint

Ask questionsNo module named 'tensorflow.tools.graph_transforms' in TF2.0

This functionality seems still included in TensorFlow 2.0, however, it raises an error when calling.

% ipython
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 16:52:21) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from tensorflow.tools.graph_transforms import TransformGraph                                                 
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-1fd86d9792e0> in <module>
----> 1 from tensorflow.tools.graph_transforms import TransformGraph

ModuleNotFoundError: No module named 'tensorflow.tools.graph_transforms'

TensorFlow version:

% pip show tensorflow
Name: tensorflow
Version: 2.0.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: /Volumes/data/venv-tf2/lib/python3.7/site-packages
Requires: gast, six, tensorboard, grpcio, termcolor, tensorflow-estimator, protobuf, keras-preprocessing, keras-applications, numpy, opt-einsum, absl-py, wrapt, wheel, astor, google-pasta
Required-by: tfcoreml

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS 10.15
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A
  • TensorFlow installed from (source or binary): binary pip install
  • TensorFlow version (use command below): 2.0.0
  • Python version: 3.7.3
  • Bazel version (if compiling from source): N/A
  • GCC/Compiler version (if compiling from source): N/A
  • CUDA/cuDNN version: N/A
  • GPU model and memory: N/A
tensorflow/tensorflow

Answer questions suharshs

This is WIA. The code is still in the repository but this code is not exposed intentionally in TF 2.0 as graphs are not central in 2.0, look to Grappler as the place for TF rewrites now.

useful!

Related questions

ModuleNotFoundError: No module named 'tensorflow.contrib'
Error occurred when finalizing GeneratorDataset iterator
ModuleNotFoundError: No module named 'tensorflow.contrib'
When importing TensorFlow, error loading Hadoop hot 4
The flag 'log_dir' is defined twice. hot 3
[TF 2.0] Dataset has no attribute 'make_one_shot_iterator' hot 3
Lossy conversion from float32 to uint8. Range [0, 1]. Convert image to uint8 prior to saving to suppress this warning. hot 3
TF2.0 AutoGraph issue hot 3
Error loading tensorflow hot 3
AttributeError: module 'tensorflow' has no attribute 'set_random_seed' hot 3
No tf.lite.experimental.nn.bidirectional_dynamic_rnn ops is finded hot 3
Incorrect Error TypeError: padded_batch() missing 1 required positional argument: &#39;padded_shapes&#39; hot 3
tensorflow2.0 detected 'xla_gpu' , but 'gpu' expected hot 2
Using tensorflow gpu 2.1 with Cuda 10.2 hot 2
Restoring Keras model fails inside a distribution strategy scope hot 2
Github User Rank List