ModuleNotFoundError: No module named 'tensorflow.tools.graph_transforms' when using export_tflite_ssd_graph.py
Asked Answered
N

2

6

I am trying to convert a saved_model from TensorFlow Object Detection Model Zoo to a tflite file. The model I am using is ssd_mobilenet_v2_oid_v4_2018_12_12.

So I used export_tflite_ssd_graph.py:

D:\TensorFlow\models\research\object_detection>python export_tflite_ssd_graph.py 
--pipeline_config_path=D:\Models\ssd_mobilenet_v2_oid_v4_2018_12_12\pipeline.config 
--trained_checkpoint_prefix=D:\Models\ssd_mobilenet_v2_oid_v4_2018_12_12\model.ckpt.data-00000-of-00001 
--output_directory=D:\Models 
--add_postprocessing_op=true

I get the following error

2020-01-20 19:43:36.765263: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-01-20 19:43:36.770058: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "export_tflite_ssd_graph.py", line 96, in <module>
    from object_detection import export_tflite_ssd_graph_lib
  File "C:\Users\Bhavin\AppData\Local\Programs\Python\Python36\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\export_tflite_ssd_graph_lib.py", line 26, in <module>
from tensorflow.tools.graph_transforms import TransformGraph
ModuleNotFoundError: No module named 'tensorflow.tools.graph_transforms'

I tried upgrading tensorflow with pip but I still get the same error.

I am using Windows 10 and TensorFlow 2.1.0.

Neuron answered 20/1, 2020 at 14:34 Comment(0)
F
3

Facing same problem. Ad hoc fix is downgrade to tf 1.15.0

Fireplace answered 1/4, 2020 at 15:10 Comment(1)
Worked perfectly for meLeader
W
0

downgrade your tensorflow version to 1.x maybe useful

Waterless answered 11/5, 2023 at 8:9 Comment(1)
Welcome to StackOverflow! This is effectively the same as a previous answer (and that one appears to have been tested by the poster as they have a specific version mentioned). The interface here can be a bit tricky at first, but do please make an effort to check if previous answers aren't already the same information you were going to post. We generally like to have unique answers so that users have a greater chance of finding something helpful that fits their particular context.Nutation

© 2022 - 2025 — McMap. All rights reserved.