Kotlin / kotlindl

High-level Deep Learning Framework written in Kotlin and inspired by Keras
Apache License 2.0
1.45k stars 104 forks source link

Model save/load compatibility with Keras #89

Open mkaze opened 3 years ago

mkaze commented 3 years ago

@zaleslaw, I was wondering if we are aiming for a two-way compatibility with Keras in terms of saving and loading of the models. In particular, should both of the following conditions satisfy?

zaleslaw commented 3 years ago

Yes, but the first priority is the loading model from Keras for Transfer Learning purposes. It's an important and popular use case.

Also, we need a good way to save the model for KotlinDL needs (currently, there are a few ways, and one of the exports to Keras-like JSON format); it's the second point here.

It's a good idea to have full export/import with Keras in both directions, hope to return to this task and open a few tickets about that.

I worry that loading to Keras will not work fully due to issues with weights export (I could not find any library for h5 writing, only for reading) and some missed things in JSON but it could be fixed in the future.

I mark this ticket as "research" and suggest to continue discussion here

dosier commented 3 years ago

I found two potentially useful projects with regards to writing h5

zaleslaw commented 3 years ago

P.S Read the Contributing Guidelines.