five-video-classification-methods
five-video-classification-methods copied to clipboard
lrcn model to onnx error
@harvitronix hello Harvey, thanks to your really good tutorial for video classification.
I followed your instruction to train my own lrcn video classification model and it works well under tensorflow&keras. But when I tried to convert this .hdf5 model to .onnx, I met this error below:
env info: tf-gpu 1.14 tb-nightly cuda10.1 onnx 1.7.0 keras2onnx 1.6.1 python3.6
Traceback (most recent call last):
File "/workspace/h52onnx.py", line 15, in
For your information, I only changed input size from self.input_shape = (seq_length, 80, 80, 3) to self.input_shape = (seq_length, 320, 320, 3).
Convert code listed below:
import keras import keras2onnx import onnx from keras.models import load_model
model = load_model('/workspace/lrcn-images.050-1.443.hdf5') onnx_model = keras2onnx.convert_keras(model, model.name) temp_model_file = '/workspace/model.onnx' onnx.save_model(onnx_model, temp_model_file)
Kindly help. Thanks again.