【发布时间】:2020-05-05 07:29:59
【问题描述】:
我正在致力于在嵌入式设备上部署模型,进行性能比较等。这是一次实习,所以我的时间真的很有限,无法重新实现/重新训练模型,但我必须使用可用的东西(我实际上是向我的主管明确询问过这个问题)。
由于 TorchScript 并不像 TF Lite 那样成熟,至少从我收集到的信息来看,我会选择后者。 2018 年之前的模型运行良好,但许多 SotA 模型(如 ResNeSt)只有 PyTorch 中的代码。然而,GluonCV 似乎在他们的动物园中提供了很好的模型选择,并且基于 TensorFlow,所以我认为有一种方法可以将这些模型导出到 SavedModel、Keras .h5 或其他任何东西,但之后我没有找到很多搜索。我找到了MMdnn,但在转换为 IR 期间尝试在 JSON 导出模型上失败(我将输出附加到底部,似乎 MXNet JSON 和 Gluon JSON 格式不同)。
还有其他人将 Gluon 模型导出到野外吗?进展如何?
谢谢!
mmtoir -f mxnet -n resnest200-symbol.json -d resnest200 --inputShape 3,257,257的输出:
/home/kmfrick/Gluon_Tinkering/venv/lib/python3.8/site-packages/mxnet/module/base_module.py:55: UserWarning: You created Module with Module(..., label_names=['softmax_label']) but input with name 'softmax_label' is not found in symbol.list_arguments(). Did you mean one of:
data
_defaultpreprocess1_init_mean
_defaultpreprocess1_init_scale
warnings.warn(msg)
Warning: MXNet Parser has not supported operator null with name data.
Warning: convert the null operator with name [data] into input layer.
Warning: MXNet Parser has not supported operator null with name _defaultpreprocess1_init_scale.
Warning: convert the null operator with name [_defaultpreprocess1_init_scale] into input layer.
terminate called after throwing an instance of 'dmlc::Error'
what(): [09:24:49] src/c_api/c_api_symbolic.cc:540: InferShapeKeyword argument name data not found.
Candidate arguments:
[0]_defaultpreprocess1_init_scale
Stack trace:
[bt] (0) /home/kmfrick/Gluon_Tinkering/venv/lib/python3.8/site-packages/mxnet/libmxnet.so(+0x307d3b) [0x7f0127eb9d3b]
[bt] (1) /home/kmfrick/Gluon_Tinkering/venv/lib/python3.8/site-packages/mxnet/libmxnet.so(+0x33a3755) [0x7f012af55755]
【问题讨论】:
-
gluoncv 基于 MXNet,而不是 TensorFlow
标签: python tensorflow tensorflow-lite mxnet gluon