Cannot convert Keras saved model
See original GitHub issueSystem information
- Ubuntu 18.04 WSL
- tensorflow 2.5.0
Describe the problem
Model convertion using tensorflowjs_converter --input_format=keras_saved_model ./model_autokeras ./converted_model
throws following error:
RuntimeError: Unable to restore a layer of class Custom>MultiCategoryEncoding. Layers of class Custom>MultiCategoryEncoding require that the class be provided to the model loading code, either by registering the class using @keras.utils.register_keras_serializable on the class def and including that file in your program, or by passing the class in a keras.utils.CustomObjectScope that wraps this load call.
My model has been generated using Autokeras StructuredDataRegressor.
Provide the exact sequence of commands / steps that you executed before running into the problem
This can be reproduced by following this tutorial: https://autokeras.com/tutorial/structured_data_regression/
And then run tensorflowjs_converter --input_format=keras_saved_model ./model_autokeras ./converted_model
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top GitHub Comments
Looks like you might have a custom layer that is not supported “natively” in Tensorflow.js. Have you tried changing the output format to
--output_format=tfjs_graph_model
?Are you satisfied with the resolution of your issue? Yes No