610265158/face_landmark

尝试把tf1分支下的模型pb文件转mnn,遇到如下报错。

Kay-Tian opened this issue · 3 comments

Don't support not const scale node
Converte Tensorflow's Op tower_0/ShuffleNetV2/Stage4/unit_4/conv1x1_after/BatchNorm/cond/FusedBatchNorm_1 , type = FusedBatchNorm, failed, may be some node is not const
[10:33:37] /Users/Jin/OpenSourceCode/MNN/tools/converter/source/optimizer/PostConverter.cpp:20: Inputs: training_flag
[10:33:37] /Users/Jin/OpenSourceCode/MNN/tools/converter/source/optimizer/PostConverter.cpp:20: Inputs: tower_0/images
[10:33:37] /Users/Jin/OpenSourceCode/MNN/tools/converter/source/optimizer/PostConverter.cpp:37: Outputs: tower_0/SpatialSqueeze, Type = Squeeze
The Model Has Control / Extra Op, Please Compile the Code of model.cpp or use model.py
libc++abi.dylib: terminating with uncaught exception of type Error: [10:33:37] /Users/Jin/OpenSourceCode/MNN/tools/converter/source/common/writeFb.cpp:107: Check failed: (notSupportOps.size()) == (0) ==> These Op Not Support: Tensorflow::FusedBatchNorm |
Abort trap: 6

请问有什么建议吗?在MNN的Issue里搜到这条:
#594
对tf不太熟悉,怎么导出模型为is_training = false呢?请指点一下。

我已经转好了一个了,需要把is_training 写死成false, 加载参数,保存ckpt 再保存成pb,进行转换

有空了,我会再写个脚本来做转换到MNN,
tensorflow模型如果有batchnorm层, 转MNN这一步操作是必须的

好的,谢谢。我是在尝试使用你转好的那个mnn模型发现结果与tf的对应不上,所以尝试自己转一下。不知能否提供一个你测试mnn模型的脚本?