convert .pb model to tflite model run the bug: RuntimeError: TOCO failed see console for info. 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. 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\\tensorflow\\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
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
Check out this answer:
https://stackoverflow.com/a/58583419/11517841
Using Colab to convert your .pb into .lite is much simpler!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.