模型是在tensorflow r1.12中训练的,所以使用tensorflow r1.12的源码编译libtensorflow_inference.so来配套移植到Android端,结果报了以下两个错误:
1. Op type not registered 'NonMaxSuppressionV3' in binary running on localhost. Make sure the Op and Kernel are registered in the binary running in this process.
参考:https://www.jianshu.com/p/056ba3cbf02a
2. No OpKernel was registered to support Op 'DenseToDenseSetOperation' with these attrs. Registered devices: [CPU], Registered kernels:
1) 在tensorflow/contrib/makefile/tf_op_files.txt中添加set_kernels.cc
2) 在tensorflow/core/kernels/BUILD中找到:
filegroup(
name = "android_extended_ops_group2",
srcs = [
]
在srcs里面加上set_kernels.cc
3) 重新编译libtensorflow_inference.so