将keras的h5模型转化为onnx
先安装
pip install keras2onnx
import keras
import keras2onnx
import onnx
from keras.models import load_model
model = load_model('/root/notebook/model/river_model5.h5')
onnx_model = keras2onnx.convert_keras(model, model.name)
temp_model_file = '/root/notebook/model/model.onnx'
onnx.save_model(onnx_model, temp_model_file)
参考官方文档
https://pypi.org/project/keras2onnx/ 官方文档是个好东西
标签:load,keras,onnx,h5,keras2onnx,model From: https://blog.51cto.com/u_15202985/6022887