我尝试用Keras训练模型并在android上运行。
我的模型(扩展名为.pb)已正确加载并解析,之后我调用了它:
tensorFlowInferenceInterface.run(outputNames, true);
之后我就遇到了这个问题:
E/TensorFlowInferenceInterface: Failed to run TensorFlow inference with inputs:[main_input], outputs:[action_sm/Relu]
E/TensorflowAndroid: java.lang.IllegalArgumentException: No OpKernel was registered to support Op 'NotEqual' with these attrs. Registered devices: [CPU], Registered kernels:
<no registered kernels>
[[Node: NotEqual = NotEqual[T=DT_FLOAT](action_sm_sample_weights, NotEqual/y)]]
我尝试使用最新版本的库(1.3.1-alpha),但它没有帮助。
答案 0 :(得分:0)
此代码可帮助我保存适用于Android的模型:
continue