我一直在尝试在 ml5.js soundClassifier 层中转换 Mozilla Deepspeech 训练模型以用于 tensorflow.js。我的理解是 Mozilla DeepSpeech 使用 TensorFlow。我一直在尝试遵循此处找到的提示:
https://www.tensorflow.org/js/tutorials/conversion/import_saved_model
https://www.tensorflow.org/js/guide/conversion
tensorflowjs_converter --help
我从这里下载了 DeepSpeech 模型:
https://github.com/mozilla/DeepSpeech/releases/download/v0.6.1/deepspeech-0.6.1-models.tar.gz
并且解压后发现如下文件:
lm.binary output_graph.pb output_graph.pbmm output_graph.tflite trie
我试图运行以下命令:
tensorflowjs_converter --output_format=tfjs_graph_model --saved_model_tags=serve deep/ tensorflow.js/
以及进行转换的变体。 tensorflow.js/
是我创建deep/
的目录,是包含 DeepSpeech 模型文件的目录(上面列出了。)
我得到错误:
SavedModel file does not exist at: deep/saved_model.pb/{saved_model.pbtxt|saved_model.pb}
我重命名output_graph.pb
为saved_model.pb
.
首先,我想知道 DeepSpeech 模型是否与 tensorflowjs_converter 兼容,如果是,我缺少什么才能让这个东西正常工作。