小编袁明帅*_*袁明帅的帖子

语音命令android demo提供的tflite格式的模型如何转换?

我使用lite Converter将我的pb格式模型转换为tflite格式,并使用lite Interpreter运行这个模型,但是效果不好,报错是:

Traceback (most recent call last):
  File "/home/yuan/anaconda3/envs/TFLite/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/home/yuan/tensorflow-master/tensorflow/examples/speech_commands/audio/audio_processor_lite.py", line 41, in run
    self._interpreter.allocate_tensors()
  File "/home/yuan/anaconda3/envs/TFLite/lib/python3.7/site-packages/tensorflow_core/lite/python/interpreter.py", line 198, in allocate_tensors
    return self._interpreter.AllocateTensors()
  File "/home/yuan/anaconda3/envs/TFLite/lib/python3.7/site-packages/tensorflow_core/lite/python/interpreter_wrapper/tensorflow_wrap_interpreter_wrapper.py", line 106, in AllocateTensors
    return _tensorflow_wrap_interpreter_wrapper.InterpreterWrapper_AllocateTensors(self)
RuntimeError: Regular TensorFlow ops are not supported by this interpreter. Make sure you invoke the Flex delegate before inference.Node number 0 (FlexAudioSpectrogram) failed to prepare.

Run Code Online (Sandbox Code Playgroud)

看起来 lite 还不支持 FlexAudioSpectrogram 操作。但是当我使用speech command android demo提供的tflite模型时,效果很好。所以我想知道这个模型是如何转换的?

python tensorflow tensorflow-lite

6
推荐指数
1
解决办法
366
查看次数

标签 统计

python ×1

tensorflow ×1

tensorflow-lite ×1