[英]Prediction differences between keras and tensorflow lite model
I've created keras model to recognize human activity, based on data from mobile accelerometer:根据来自移动加速度计的数据,我创建了 keras model 来识别人类活动:
model = Sequential()
model.add(Reshape((const.PERIOD, const.N_FEATURES), input_shape=(240,)))
model.add(Conv1D(100, 10, activation='relu', input_shape=(const.PERIOD, const.N_FEATURES)))
model.add(Conv1D(100, 10, activation='relu'))
model.add(MaxPooling1D(const.N_FEATURES))
model.add(Conv1D(160, 10, activation='relu'))
model.add(Conv1D(160, 10, activation='relu'))
model.add(Flatten())
model.add(Dropout(0.5))
model.add(Dense(7, activation='softmax'))
model.summary()
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
I've tested model, and the accuracy after ten epochs is like 85-90%.我已经测试过 model,十个 epoch 后的准确率大约是 85-90%。 I don't know, but when I converse my model to TF Lite and I run interpreter in my android app, there's horrible predictions.
我不知道,但是当我将 model 转换为 TF Lite 并在我的 android 应用程序中运行解释器时,会有可怕的预测。 What can be reason of that bad results?
结果不好的原因是什么? No compatibility on keras -> tensorflow -> tensorflow lite line?
keras -> tensorflow -> tensorflow lite line 不兼容? Should I run it with another way, using something like servlet + keras model?
我应该以另一种方式运行它,使用类似 servlet + keras model 之类的东西吗?
A few suggestions:几点建议:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.