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.

How to solve Tensorflow.js Converter error?

See original GitHub issue

I’m trying to convert frozen graph to json file. I use this command:

tensorflowjs_converter --input_format=tf_frozen_model --output_node_names="SemanticPredictions" --saved_model_tags=serve frozen_inference_graph.pb mymodal

But it gives this error:

Traceback (most recent call last):
  File "d:\programdata\anaconda3\envs\tensorflow0\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "d:\programdata\anaconda3\envs\tensorflow0\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\ProgramData\Anaconda3\envs\tensorflow0\Scripts\tensorflowjs_converter.exe\__main__.py", line 7, in <module>
  File "d:\programdata\anaconda3\envs\tensorflow0\lib\site-packages\tensorflowjs\converters\converter.py", line 645, in pip_main
    main([' '.join(sys.argv[1:])])
  File "d:\programdata\anaconda3\envs\tensorflow0\lib\site-packages\tensorflowjs\converters\converter.py", line 649, in main
    convert(argv[0].split(' '))
  File "d:\programdata\anaconda3\envs\tensorflow0\lib\site-packages\tensorflowjs\converters\converter.py", line 632, in convert
    strip_debug_ops=args.strip_debug_ops)
  File "d:\programdata\anaconda3\envs\tensorflow0\lib\site-packages\tensorflowjs\converters\tf_saved_model_conversion_v2.py", line 379, in convert_tf_frozen_model
    strip_debug_ops=strip_debug_ops)
  File "d:\programdata\anaconda3\envs\tensorflow0\lib\site-packages\tensorflowjs\converters\tf_saved_model_conversion_v2.py", line 133, in optimize_graph
    graph.add_to_collection('train_op', graph.get_operation_by_name(name))
  File "d:\programdata\anaconda3\envs\tensorflow0\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3633, in get_operation_by_name
    return self.as_graph_element(name, allow_tensor=False, allow_operation=True)
  File "d:\programdata\anaconda3\envs\tensorflow0\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3505, in as_graph_element
    return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
  File "d:\programdata\anaconda3\envs\tensorflow0\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3565, in _as_graph_element_locked
    "graph." % repr(name))
KeyError: "The name 'SemanticPredictions' refers to an Operation not in the graph."

I don’t why it gives KeyError: "The name 'SemanticPredictions' refers to an Operation not in the graph." error.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11

github_iconTop GitHub Comments

13reactions
sundowatchcommented, Mar 3, 2020

Ok my mistake. I was using loadLayersModel() instead of loadGraphModel()

0reactions
sundowatchcommented, Mar 3, 2020

Ok, I’ve converted saved_model with this code: tensorflowjs_converter --input_format=tf_saved_model --output_format=tfjs_graph_model --signature_name=serving_default --saved_model_tags=serve saved_model saved_model/custom_model

But now when I load this onto page it gives error like this: Uncaught (in promise) Error: layer: Improper config format: {"node": ...........................

I don’t know what have I done wrong.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve Tensorflow.js Converter error? - Stack Overflow
I'm trying to convert frozen graph to json file. I use this command: tensorflowjs_converter --input_format=tf_frozen_model ...
Read more >
Tensorflowjs conversion error from tflite-model-maker ...
Step 2 SAVED_MODEL → TFJS ( Failed )​​ It seems some of the ops your TFLite model is using are not supported in...
Read more >
Unclear error from tensorflowjs_converter of USE large from ...
Run a TensorFlow SavedModel in Node.js directly without conversion. The TensorFlow blog contains regular news from the TensorFlow team and the community, with ......
Read more >
Setup | TensorFlow.js
Node.js Setup · Option 1: Install TensorFlow.js with native C++ bindings. tfjs-node · Option 2: (Linux Only) If your system has a NVIDIA®...
Read more >
TFJS model not working problem - TensorFlow Forum
js — The TensorFlow Blog I tried everything on this site in colab. There are some problems. If I load the requirements.txt specified...
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