简体   繁体   English

将 .pb 转换为 .tflite ,RuntimeError: TOCO failed 请参阅控制台了解信息

[英]convert .pb to .tflite ,RuntimeError: TOCO failed see console for info

convert .pb model to tflite model run the bug: RuntimeError: TOCO failed see console for info.将 .pb 模型转换为 tflite 模型运行错误:RuntimeError: TOCO failed 请参阅控制台了解信息。 b'e:\\anaconda3\\lib\\site-packages\\h5py\\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. b'e:\\anaconda3\\lib\\site-packages\\h5py\\__init__.py:36:FutureWarning:不推荐将np.floating的第二个参数从floatnp.floating In future, it will be treated as np.float64 == np.dtype(float).type .\\r\\n from ._conv import register_converters as _register_converters\\r\\nTraceback (most recent call last):\\r\\n File "e:\\anaconda3\\lib\\site-packages\\tensorflow\\contrib\\lite\\toco\\python\\tensorflow_wrap_toco.py", line 18, in swig_import_helper\\r\\n fp, pathname, description = imp.find_module(\\'_tensorflow_wrap_toco\\', [dirname( file )])\\r\\n File "e:\\anaconda3\\lib\\imp.py", line 297, in find_module\\r\\n raise ImportError(_ERR_MSG.format(name), name=name)\\r\\nImportError: No module named \\'_tensorflow_wrap_toco\\'\\r\\n\\r\\nDuring handling of the above exception, another exception occurred:\\r\\n\\r\\nTraceback (most recent call last):\\r\\n File "e:\\anaconda3\\lib\\runpy.py", line 193, in _run_module_as_main\\r\\n " main ", mod_spec)\\r\\n File "e:\\anaconda3\\lib\\runpy.py", line 85, in _run_code\\r\\n exec(code, run_globals)\\r\\n File "E:\\Anaconda3\\Scripts\\toco_from_protos.exe\\__main__.py", line 5, in \\r\\n File "e:\\anaconda3\\lib\\site-packages\\ten将来,它将被视为np.float64 == np.dtype(float).type .\\r\\n from ._conv import register_converters as _register_converters\\r\\nTraceback(最近一次调用最后一次):\\r\\n File " e:\\anaconda3\\lib\\site-packages\\tensorflow\\contrib\\lite\\toco\\python\\tensorflow_wrap_toco.py", line 18, in swig_import_helper\\r\\n fp, pathname, description = imp.find_module(\\'_tensorflow_wrap_toco\\' , [dirname( file )])\\r\\n File "e:\\anaconda3\\lib\\imp.py", line 297, in find_module\\r\\n raise ImportError(_ERR_MSG.format(name), name=name)\\ r\\nImportError: No module named \\'_tensorflow_wrap_toco\\'\\r\\n\\r\\n在处理上述异常的过程中,发生了另一个异常:\\r\\n\\r\\n回溯(最近一次调用最后一次):\\r\\n 文件"e:\\anaconda3\\lib\\runpy.py", line 193, in _run_module_as_main\\r\\n " main ", mod_spec)\\r\\n File "e:\\anaconda3\\lib\\runpy.py", line 85, in _run_code\\r\\n exec(code, run_globals)\\r\\n 文件“E:\\Anaconda3\\Scripts\\toco_from_protos.exe\\__main__.py”,第 5 行,\\r\\n 文件“e:\\anaconda3\\lib\\站点包\\十sorflow\\contrib\\lite\\toco\\python\\toco_from_protos.py", line 22, in \\r\\n from tensorflow.contrib.lite.toco.python import tensorflow_wrap_toco\\r\\n File "e:\\anaconda3\\lib\\site-packages\\tensorflow\\contrib\\lite\\toco\\python\\tensorflow_wrap_toco.py", line 28, in \\r\\n _tensorflow_wrap_toco = swig_import_helper()\\r\\n File "e:\\anaconda3\\lib\\site-packages\\tensorflow\\contrib\\lite\\toco\\python\\tensorflow_wrap_toco.py", line 20, in swig_import_helper\\r\\n import _tensorflow_wrap_toco\\r\\nModuleNotFoundError: No module named \\'_tensorflow_wrap_toco\\'\\r\\n' None sorflow\\contrib\\lite\\toco\\python\\toco_from_protos.py”,第 22 行,在 \\r\\n from tensorflow.contrib.lite.toco.python import tensorflow_wrap_toco\\r\\n 文件“e:\\anaconda3\\lib\\site- packages\\tensorflow\\contrib\\lite\\toco\\python\\tensorflow_wrap_toco.py”,第 28 行,在 \\r\\n _tensorflow_wrap_toco = swig_import_helper()\\r\\n 文件“e:\\anaconda3\\lib\\site-packages\\tensorflow\\contrib \\lite\\toco\\python\\tensorflow_wrap_toco.py", line 20, in swig_import_helper\\r\\n import _tensorflow_wrap_toco\\r\\nModuleNotFoundError: No module named \\'_tensorflow_wrap_toco\\'\\r\\n' None

Check your graph.检查你的图表。 You might be using some unsupported operations: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/lite/g3doc/tf_ops_compatibility.md您可能正在使用一些不受支持的操作: https : //github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/lite/g3doc/tf_ops_compatibility.md

Check out this answer:看看这个答案:

https://stackoverflow.com/a/58583419/11517841 https://stackoverflow.com/a/58583419/11517841

Using Colab to convert your .pb into .lite is much simpler!使用 Colab 将您的 .pb 转换为 .lite 简单得多!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将ssd_mobilenet转换为tensorflow lite throws,ConverterError:TOCO失败。 请参阅控制台以获取信息 - Converting ssd_mobilenet to tensorflow lite throws, ConverterError: TOCO failed. See console for info RuntimeError: 未能导入transformers.pipelines,因为以下错误(查看它的回溯):初始化失败 - RuntimeError: Failed to import transformers.pipelines because of the following error (look up to see its traceback): initialization failed 如何将 .ckpt 转换为 .pb? - How to convert .ckpt to .pb? 无法将张量流模型转换为tflite - Unable to convert the tensorflow model to tflite Tensorflow Lite:如何检查 input_layer_shape 和 input_layer_type 以将 pb 转换为 tflite - Tensorflow Lite: How to check input_layer_shape and input_layer_type for converting pb to tflite 如何找到将.PB文件(更快的RCNN模型)转换为TFlite文件的输入和输出张量? - How to find the Input and Output Tensors for converting a .PB file (Faster RCNN Model) to a TFlite file? Tensorflow 2.0 将 keras 模型转换为 .pb 文件 - Tensorflow 2.0 Convert keras model to .pb file Keras Model hdf5 无法转换 Tflite - Keras Model hdf5 failing to convert Tflite RuntimeError:运行cythonize失败! Statsmodels安装 - RuntimeError: Running cythonize failed! Statsmodels installation 如何在 Colab 中将 Inception V4 从 .ckpt 转换为 .pb? - How to convert Inception V4 from .ckpt to .pb in Colab?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM