Failed to convert TF2.0alpha SavedModel to TFjs
See original GitHub issueTensorFlow.js version
tensorflowjs 1.0.1
Dependency versions:
keras 2.2.4-tf
tensorflow 2.0.0-dev20190514
Describe the problem or feature request
Trained a DCGAN model on TF2.0alpha following https://www.tensorflow.org/alpha/tutorials/generative/dcgan Model was saved using :
savedmodel_dir = './saved_model'
# Save entire model to file
tf.saved_model.save(checkpoint, savedmodel_dir)
Upon converting, process fails:
>>>tensorflowjs_converter --input_format=tf_saved_model --output_format=tfjs_graph_model ./saved_model ./tfjs
2019-05-14 07:40:48.309285: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-05-14 07:40:48.317475: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_23
2019-05-14 07:40:48.321557: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_46
2019-05-14 07:40:48.325628: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_69
2019-05-14 07:40:48.329328: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_92
2019-05-14 07:40:48.338003: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_139
2019-05-14 07:40:48.347011: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_185
2019-05-14 07:40:48.351357: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_208
2019-05-14 07:40:48.360077: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_254
2019-05-14 07:40:48.368190: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_300
2019-05-14 07:40:48.370270: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_309
2019-05-14 07:40:48.378704: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_355
2019-05-14 07:40:48.456612: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_824
2019-05-14 07:40:48.463504: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_847
2019-05-14 07:40:48.471019: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_894
2019-05-14 07:40:48.572809: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference_restore_1646
2019-05-14 07:40:48.580197: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_1669
2019-05-14 07:40:48.583672: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_1692
2019-05-14 07:40:48.587069: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_1715
2019-05-14 07:40:48.588915: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_1724
2019-05-14 07:40:48.632833: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference_save_2040
2019-05-14 07:40:48.642437: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_2087
2019-05-14 07:40:48.653423: W tensorflow/core/common_runtime/eager/context.cc:367] Added two functions with the same name: __inference__wrapped_model_2163
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/bin/tensorflowjs_converter", line 10, in <module>
sys.exit(main())
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflowjs/converters/converter.py", line 358, in main
strip_debug_ops=FLAGS.strip_debug_ops)
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 268, in convert_tf_saved_model
model = load(saved_model_dir, saved_model_tags)
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/saved_model/load.py", line 407, in load
export_dir)
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/saved_model/load.py", line 58, in __init__
self._load_all()
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/saved_model/load.py", line 168, in _load_all
slot_variable = optimizer_object.add_slot(
AttributeError: '_UserObject' object has no attribute 'add_slot'
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x102f5f160>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e3a4668>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e3e0b00>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e3eddd8>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e40e080>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e40e588>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e435908>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e465860>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e465a20>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e4acf98>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e4b66d8>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e6de710>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e6de828>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e554f28>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e755e80>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e5673c8>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e4e86a0>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e511978>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e507eb8>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12eb71c88>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e73b1d0>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Exception ignored in: <bound method _EagerDefinedFunctionDeleter.__del__ of <tensorflow.python.eager.function._EagerDefinedFunctionDeleter object at 0x12e54a668>>
Traceback (most recent call last):
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 305, in __del__
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 1639, in remove_function
File "/Users/noyman/anaconda3/envs/tfjs36/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 863, in remove_function
TypeError: 'NoneType' object is not callable
Code to reproduce the bug / link to feature request
Same as https://www.tensorflow.org/alpha/tutorials/generative/dcgan with the added SaveModel API
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
javascript - Error Trying to Convert TensorFlow Saved Model ...
Now I want to convert my saved model to use it with the JavaScript version of TensorFlow, tf.js, using the tfjs-converter.
Read more >Model conversion | TensorFlow.js
The TensorFlow.js converter works with several different model formats: SavedModel: This is the default format in which TensorFlow models ...
Read more >Convert a Python SavedModel to TensorFlow.js format
In this codelab, you'll learn how to take an existing Python ML model that is in the SavedModel format and convert it to...
Read more >tfjs-converter - GitHub Pages
A 2-step process to import your model: A python pip package to convert a TensorFlow SavedModel/Frozen Model/Session Bundle to a web friendly format....
Read more >help with tfjs converter for saved model - weights not saved ...
I'm struggling to figure out how to properly save a tensorflow model that was saved as a saved_model method and convert it to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rthadur I could not reproduce this again, so probably fixed. Thanks!
Thank you, closing this issue.