question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tensorflow.tools.graph_transforms missing?

See original GitHub issue
python main.py --upscale --scale 4 --image FILEPATH

Traceback (most recent call last):
  File "/home/mb/scripts/EDSR_Tensorflow/main.py", line 3, in <module>
    import run
  File "/home/mb/scripts/EDSR_Tensorflow/run.py", line 13, in <module>
    from tensorflow.tools.graph_transforms import TransformGraph
ModuleNotFoundError: No module named 'tensorflow.tools.graph_transforms'

I’m Manjaro, and Tensorflow 2.5

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ManuLinarescommented, Jun 22, 2021

Sorry . I meant the Nvidia tf docker container version

You can try tf 1.9 . It’s working for me

Could you tell me what image you’re using? and Maybe steps after. I’m trying this without success.

docker run --gpus all -it --rm -v $PWD:/tmp -w /tmp tensorflow/tensorflow:1.14.0-gpu-py3 bash
pip install -U pip
pip install -r requirements.txt
python main.py --upscale --scale 4 --image 1.png

Traceback (most recent call last):
  File "main.py", line 2, in <module>
    import data_utils
  File "/tmp/data_utils.py", line 5, in <module>
    import cv2
  File "/usr/local/lib/python3.6/dist-packages/cv2/__init__.py", line 5, in <module>
    from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

EDIT:

I had a success but I had to do some stuff like installing pip install opencv-python-headless and replacing code to not use the function “cv2.imshow” like this:


--- a/run.py
+++ b/run.py
@@ -302,12 +302,14 @@ class run:
 
             bicubic_image = cv2.resize(fullimg, None, fx=self.scale, fy=self.scale, interpolation=cv2.INTER_CUBIC)
 
-            cv2.imshow('Original image', fullimg)
-            cv2.imshow('EDSR upscaled image', HR_image)
-            cv2.imshow('Bicubic upscaled image', bicubic_image)
+            #cv2.imshow('Original image', fullimg)
+            #cv2.imshow('EDSR upscaled image', HR_image)
+            #cv2.imshow('Bicubic upscaled image', bicubic_image)
 
-            cv2.waitKey(0)
-            cv2.destroyAllWindows()
+            #cv2.waitKey(0)
+            #cv2.destroyAllWindows()
+            cv2.imwrite("./output.png", HR_image)
+            #print("path is:",path)

EDIT2: for multiple file processing, made a bash script (just sharing)

mkdir -p input; mkdir -p output; mkdir -p output/input
#put png's in "input" dir
find input -name '*.png'| sort | awk '{print "python main.py --upscale --scale 4 --image "$1" ; mv output.png output/"$s}'|bash

0reactions
Saafkecommented, Jun 21, 2021

Hi guys,

Thanks for the question/discussion. I am using TensorFlow 1.14.0 and it’s working. I added a requirements.txt. Let me know if it works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No 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.
Read more >
python - Couldn't import 'tensorflow.tools.graph_transforms' in ...
I have a problem with importing import tensorflow ...
Read more >
no module named 'tensorflow.tools.graph_transforms - You.com
Looks like from tensorflow.tools.graph_transforms import TransformGraph has been removed in TF 2.x. Alternative is use Grappler. This issue https://github.com/ ...
Read more >
tensorflow/tools/graph_transforms - GitLab
The Graph Transform tool is designed to work on models that are saved as GraphDef files, usually in a binary protobuf format. This...
Read more >
Graph Transform Tool - Google Git
Optimizing for Deployment; Fixing Missing Kernel Errors on Mobile; Shrinking File Size ... bazel build tensorflow/tools/graph_transforms:transform_graph ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found