Open JRF63 opened 7 months ago
Hi, @JRF63
I apologize for the delayed response and as far I know the TensorFlow.js
converter currently does not support converting Keras
models saved in the new format .keras
. it's still relatively new and hasn't been fully integrated with the TensorFlow.js converter yet. TensorFlow.js developer team is actively developing the tfjs-converter
and support for the new .keras
format might be added in future releases.
Thank you for bringing this issue to our attention! I've been able to reproduce the problem you described in the issue template. At the moment while we wait for the tfjs-converter
to support the new .keras
format, you can use a temporary workaround by simply saving your model in the .h5
format for TensorFlow.js conversion. I've tested this approach and it seems like working as expected.
For your reference I've created a gist containing your code snippet that demonstrates saving the model in .h5
format and it's working as expected, please refer this gist-file
Thank you for your understanding and patience.
Are there any updates regarding the support of .keras models?
System information
Describe the current behavior
tensorflow 2.16.1 requires keras>=3.0.0, but I think passing the
save_format
argument is a hard error in keras>=3.0.0 if the extension is not .h5/.hdf5/.keras (current code is using a .savedmodel).Describe the expected behavior
Avoid using
save_format
.Standalone code to reproduce the issue
then
Other info / logs
Setting the env var
export TF_USE_LEGACY_KERAS=1
avoids this problem.