简体   繁体   中英

How to save different keras model into one .h5py

I am trying to do video classification using Conv2D and LSTM. After getting the features from Conv2D I pass them to LSTM. As they are two different models how can I merge them into one for getting a single.h5py?

And also the features from Conv2D are passed to LSTM as sequences of frames saved as ".npy" array files.

I need to save the model for different purposes.

Assuming you are using tf keras for merge you can use this method:

model = keras.models.Model(inputs=[Conv2D, LSTM], outputs=out)

And to save your model you can just use.save as explained here

model.save('your_model.h5')

Not exactly sure if this is what you need but hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM