conversion error while converting tf saved model to tflite









up vote
0
down vote

favorite












I am trying to convert a saved model tf to a tflite mode. I am getting following error in tensorflow c++ while conversion:-



tensorflow/contrib/lite/toco/tooling_util.cc:981] Check failed: name.substr(colon_pos + 1).find_first_not_of("0123456789") == string::npos (1 vs. 18446744073709551615)Array name must only have digits after colonn'


Here is the source code :-



def convert_to_tflite_util(model_dir, output_dir):
tag_constants = set(["train"])
converter = tf.contrib.lite.TocoConverter.from_saved_model(model_dir, tag_set=tag_constants)
#converter = tf.contrib.lite.TocoConverter.from_saved_model(model_dir)
tflite_model = converter.convert()


Logs :-



2018-11-09 11:44:11.410085: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
INFO:tensorflow:Restoring parameters from /Users/deosingh/code/mldev/sensei-on-device/converters/deeplasso_converter/model/variables/variables
INFO:tensorflow:The given SavedModel MetaGraphDef contains SignatureDefs with the following keys: 'serving_default'
INFO:tensorflow:input tensors info:
INFO:tensorflow:Tensor's key in saved_model's tensor_map: input
INFO:tensorflow: tensor name: data:0, shape: (-1, 320, 320, 4), type: DT_FLOAT
INFO:tensorflow:output tensors info:
INFO:tensorflow:Tensor's key in saved_model's tensor_map: output
INFO:tensorflow: tensor name: prob:0, shape: (1, 320, 320, 2), type: DT_FLOAT
INFO:tensorflow:Restoring parameters from /Users/deosingh/code/mldev/model/variables/variables
INFO:tensorflow:Froze 387 variables.
INFO:tensorflow:Converted 387 variables to const ops.
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1664, in <module>
main()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1658, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1068, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"n", file, 'exec'), glob, loc)
File "/Users/deosingh/code/mldev/src/tf_to_tflite.py", line 112, in <module>
main()
File "/Users/deosingh/code/mldev/src/tf_to_tflite.py", line 108, in main
convert_to_tflite_util(args.src_dir, args.dest_dir)
File "/Users/deosingh/code/mldev/src/tf_to_tflite.py", line 91, in convert_to_tflite_util
tflite_model = converter.convert()
File "/Users/deosingh/code/mldev/venv/lib/python3.6/site-packages/tensorflow/contrib/lite/python/lite.py", line 439, in convert
**converter_kwargs)
File "/Users/deosingh/code/mldev/venv/lib/python3.6/site-packages/tensorflow/contrib/lite/python/convert.py", line 309, in toco_convert_impl
input_data.SerializeToString())
File "/Users/deosingh/code/mldev/venv/lib/python3.6/site-packages/tensorflow/contrib/lite/python/convert.py", line 109, in toco_convert_protos
(stdout, stderr))
RuntimeError: TOCO failed see console for info.
b'2018-11-09 11:44:18.328373: F tensorflow/contrib/lite/toco/tooling_util.cc:981] Check failed: name.substr(colon_pos + 1).find_first_not_of("0123456789") == string::npos (1 vs. 18446744073709551615)Array name must only have digits after colonn'
None


Link to tensorflow source which is throwing this error.



The original model was in caffe , then was converted to tensorflow using mmdnn . Converter is complaining about name not being in the correct format i.e doesn't expect _ after : as per the tf source. Please let me know how to resolve/debug this error. Since the tf source which isthrowing this error is in c++ and I am invoking it through python I am not able to debug it through pycharm on macosx.










share|improve this question





















  • Are you using Windows or MacOS
    – Shubham Panchal
    Nov 13 at 3:54














up vote
0
down vote

favorite












I am trying to convert a saved model tf to a tflite mode. I am getting following error in tensorflow c++ while conversion:-



tensorflow/contrib/lite/toco/tooling_util.cc:981] Check failed: name.substr(colon_pos + 1).find_first_not_of("0123456789") == string::npos (1 vs. 18446744073709551615)Array name must only have digits after colonn'


Here is the source code :-



def convert_to_tflite_util(model_dir, output_dir):
tag_constants = set(["train"])
converter = tf.contrib.lite.TocoConverter.from_saved_model(model_dir, tag_set=tag_constants)
#converter = tf.contrib.lite.TocoConverter.from_saved_model(model_dir)
tflite_model = converter.convert()


Logs :-



2018-11-09 11:44:11.410085: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
INFO:tensorflow:Restoring parameters from /Users/deosingh/code/mldev/sensei-on-device/converters/deeplasso_converter/model/variables/variables
INFO:tensorflow:The given SavedModel MetaGraphDef contains SignatureDefs with the following keys: 'serving_default'
INFO:tensorflow:input tensors info:
INFO:tensorflow:Tensor's key in saved_model's tensor_map: input
INFO:tensorflow: tensor name: data:0, shape: (-1, 320, 320, 4), type: DT_FLOAT
INFO:tensorflow:output tensors info:
INFO:tensorflow:Tensor's key in saved_model's tensor_map: output
INFO:tensorflow: tensor name: prob:0, shape: (1, 320, 320, 2), type: DT_FLOAT
INFO:tensorflow:Restoring parameters from /Users/deosingh/code/mldev/model/variables/variables
INFO:tensorflow:Froze 387 variables.
INFO:tensorflow:Converted 387 variables to const ops.
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1664, in <module>
main()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1658, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1068, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"n", file, 'exec'), glob, loc)
File "/Users/deosingh/code/mldev/src/tf_to_tflite.py", line 112, in <module>
main()
File "/Users/deosingh/code/mldev/src/tf_to_tflite.py", line 108, in main
convert_to_tflite_util(args.src_dir, args.dest_dir)
File "/Users/deosingh/code/mldev/src/tf_to_tflite.py", line 91, in convert_to_tflite_util
tflite_model = converter.convert()
File "/Users/deosingh/code/mldev/venv/lib/python3.6/site-packages/tensorflow/contrib/lite/python/lite.py", line 439, in convert
**converter_kwargs)
File "/Users/deosingh/code/mldev/venv/lib/python3.6/site-packages/tensorflow/contrib/lite/python/convert.py", line 309, in toco_convert_impl
input_data.SerializeToString())
File "/Users/deosingh/code/mldev/venv/lib/python3.6/site-packages/tensorflow/contrib/lite/python/convert.py", line 109, in toco_convert_protos
(stdout, stderr))
RuntimeError: TOCO failed see console for info.
b'2018-11-09 11:44:18.328373: F tensorflow/contrib/lite/toco/tooling_util.cc:981] Check failed: name.substr(colon_pos + 1).find_first_not_of("0123456789") == string::npos (1 vs. 18446744073709551615)Array name must only have digits after colonn'
None


Link to tensorflow source which is throwing this error.



The original model was in caffe , then was converted to tensorflow using mmdnn . Converter is complaining about name not being in the correct format i.e doesn't expect _ after : as per the tf source. Please let me know how to resolve/debug this error. Since the tf source which isthrowing this error is in c++ and I am invoking it through python I am not able to debug it through pycharm on macosx.










share|improve this question





















  • Are you using Windows or MacOS
    – Shubham Panchal
    Nov 13 at 3:54












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am trying to convert a saved model tf to a tflite mode. I am getting following error in tensorflow c++ while conversion:-



tensorflow/contrib/lite/toco/tooling_util.cc:981] Check failed: name.substr(colon_pos + 1).find_first_not_of("0123456789") == string::npos (1 vs. 18446744073709551615)Array name must only have digits after colonn'


Here is the source code :-



def convert_to_tflite_util(model_dir, output_dir):
tag_constants = set(["train"])
converter = tf.contrib.lite.TocoConverter.from_saved_model(model_dir, tag_set=tag_constants)
#converter = tf.contrib.lite.TocoConverter.from_saved_model(model_dir)
tflite_model = converter.convert()


Logs :-



2018-11-09 11:44:11.410085: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
INFO:tensorflow:Restoring parameters from /Users/deosingh/code/mldev/sensei-on-device/converters/deeplasso_converter/model/variables/variables
INFO:tensorflow:The given SavedModel MetaGraphDef contains SignatureDefs with the following keys: 'serving_default'
INFO:tensorflow:input tensors info:
INFO:tensorflow:Tensor's key in saved_model's tensor_map: input
INFO:tensorflow: tensor name: data:0, shape: (-1, 320, 320, 4), type: DT_FLOAT
INFO:tensorflow:output tensors info:
INFO:tensorflow:Tensor's key in saved_model's tensor_map: output
INFO:tensorflow: tensor name: prob:0, shape: (1, 320, 320, 2), type: DT_FLOAT
INFO:tensorflow:Restoring parameters from /Users/deosingh/code/mldev/model/variables/variables
INFO:tensorflow:Froze 387 variables.
INFO:tensorflow:Converted 387 variables to const ops.
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1664, in <module>
main()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1658, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1068, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"n", file, 'exec'), glob, loc)
File "/Users/deosingh/code/mldev/src/tf_to_tflite.py", line 112, in <module>
main()
File "/Users/deosingh/code/mldev/src/tf_to_tflite.py", line 108, in main
convert_to_tflite_util(args.src_dir, args.dest_dir)
File "/Users/deosingh/code/mldev/src/tf_to_tflite.py", line 91, in convert_to_tflite_util
tflite_model = converter.convert()
File "/Users/deosingh/code/mldev/venv/lib/python3.6/site-packages/tensorflow/contrib/lite/python/lite.py", line 439, in convert
**converter_kwargs)
File "/Users/deosingh/code/mldev/venv/lib/python3.6/site-packages/tensorflow/contrib/lite/python/convert.py", line 309, in toco_convert_impl
input_data.SerializeToString())
File "/Users/deosingh/code/mldev/venv/lib/python3.6/site-packages/tensorflow/contrib/lite/python/convert.py", line 109, in toco_convert_protos
(stdout, stderr))
RuntimeError: TOCO failed see console for info.
b'2018-11-09 11:44:18.328373: F tensorflow/contrib/lite/toco/tooling_util.cc:981] Check failed: name.substr(colon_pos + 1).find_first_not_of("0123456789") == string::npos (1 vs. 18446744073709551615)Array name must only have digits after colonn'
None


Link to tensorflow source which is throwing this error.



The original model was in caffe , then was converted to tensorflow using mmdnn . Converter is complaining about name not being in the correct format i.e doesn't expect _ after : as per the tf source. Please let me know how to resolve/debug this error. Since the tf source which isthrowing this error is in c++ and I am invoking it through python I am not able to debug it through pycharm on macosx.










share|improve this question













I am trying to convert a saved model tf to a tflite mode. I am getting following error in tensorflow c++ while conversion:-



tensorflow/contrib/lite/toco/tooling_util.cc:981] Check failed: name.substr(colon_pos + 1).find_first_not_of("0123456789") == string::npos (1 vs. 18446744073709551615)Array name must only have digits after colonn'


Here is the source code :-



def convert_to_tflite_util(model_dir, output_dir):
tag_constants = set(["train"])
converter = tf.contrib.lite.TocoConverter.from_saved_model(model_dir, tag_set=tag_constants)
#converter = tf.contrib.lite.TocoConverter.from_saved_model(model_dir)
tflite_model = converter.convert()


Logs :-



2018-11-09 11:44:11.410085: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
INFO:tensorflow:Restoring parameters from /Users/deosingh/code/mldev/sensei-on-device/converters/deeplasso_converter/model/variables/variables
INFO:tensorflow:The given SavedModel MetaGraphDef contains SignatureDefs with the following keys: 'serving_default'
INFO:tensorflow:input tensors info:
INFO:tensorflow:Tensor's key in saved_model's tensor_map: input
INFO:tensorflow: tensor name: data:0, shape: (-1, 320, 320, 4), type: DT_FLOAT
INFO:tensorflow:output tensors info:
INFO:tensorflow:Tensor's key in saved_model's tensor_map: output
INFO:tensorflow: tensor name: prob:0, shape: (1, 320, 320, 2), type: DT_FLOAT
INFO:tensorflow:Restoring parameters from /Users/deosingh/code/mldev/model/variables/variables
INFO:tensorflow:Froze 387 variables.
INFO:tensorflow:Converted 387 variables to const ops.
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1664, in <module>
main()
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1658, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1068, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"n", file, 'exec'), glob, loc)
File "/Users/deosingh/code/mldev/src/tf_to_tflite.py", line 112, in <module>
main()
File "/Users/deosingh/code/mldev/src/tf_to_tflite.py", line 108, in main
convert_to_tflite_util(args.src_dir, args.dest_dir)
File "/Users/deosingh/code/mldev/src/tf_to_tflite.py", line 91, in convert_to_tflite_util
tflite_model = converter.convert()
File "/Users/deosingh/code/mldev/venv/lib/python3.6/site-packages/tensorflow/contrib/lite/python/lite.py", line 439, in convert
**converter_kwargs)
File "/Users/deosingh/code/mldev/venv/lib/python3.6/site-packages/tensorflow/contrib/lite/python/convert.py", line 309, in toco_convert_impl
input_data.SerializeToString())
File "/Users/deosingh/code/mldev/venv/lib/python3.6/site-packages/tensorflow/contrib/lite/python/convert.py", line 109, in toco_convert_protos
(stdout, stderr))
RuntimeError: TOCO failed see console for info.
b'2018-11-09 11:44:18.328373: F tensorflow/contrib/lite/toco/tooling_util.cc:981] Check failed: name.substr(colon_pos + 1).find_first_not_of("0123456789") == string::npos (1 vs. 18446744073709551615)Array name must only have digits after colonn'
None


Link to tensorflow source which is throwing this error.



The original model was in caffe , then was converted to tensorflow using mmdnn . Converter is complaining about name not being in the correct format i.e doesn't expect _ after : as per the tf source. Please let me know how to resolve/debug this error. Since the tf source which isthrowing this error is in c++ and I am invoking it through python I am not able to debug it through pycharm on macosx.







tensorflow tensorflow-lite






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 9 at 20:05









deovrat singh

79411331




79411331











  • Are you using Windows or MacOS
    – Shubham Panchal
    Nov 13 at 3:54
















  • Are you using Windows or MacOS
    – Shubham Panchal
    Nov 13 at 3:54















Are you using Windows or MacOS
– Shubham Panchal
Nov 13 at 3:54




Are you using Windows or MacOS
– Shubham Panchal
Nov 13 at 3:54

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232617%2fconversion-error-while-converting-tf-saved-model-to-tflite%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232617%2fconversion-error-while-converting-tf-saved-model-to-tflite%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kleinkühnau

Makov (Slowakei)

Deutsches Schauspielhaus