Model saving doesn't work for StructuredDataRegressor
See original GitHub issueBug Description
I can’t save the best model as h5 or even a tf file
Bug Reproduction
Code for reproducing the bug:
model = regressor.export_model()
model.save('testmodel.h5')
gives me
NotImplementedError: Save or restore weights that is not an instance of `tf.Variable` is not supported in h5, use `save_format='tf'` instead. Got a model or layer CategoricalEncoding with weights ....
It suggests I use tf
instead of h5
, but when I do that I get this error
model.save('testmodel', save_format='tf')
2020-04-03 14:44:31.041453: W tensorflow/python/util/util.cc:329] Sets are not currently considered sequences, but this may change in the future, so consider avoiding using them.
*** RuntimeError: Attempting to capture an EagerTensor without building a function.
Data used by the code:
Expected Behavior
Save the best model in either h5 or tf format
Setup Details
- OS type and version: Ubuntu 18.04.01
- Python: 3.6.6
- autokeras: 1.0.2
- scikit-learn: 0.20.3
- numpy: 1.18.2
- pandas: 1.0.1
- tensorflow: 2.2.0-dev20200401 (nightly)
Additional context
I also can’t load the model json after saving it but I think that’s related to #1023
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (5 by maintainers)
Top Results From Across the Web
Developers - Model saving doesn't work for StructuredDataRegressor -
Bug Description. I can't save the best model as h5 or even a tf file. Bug Reproduction. Code for reproducing the bug: model...
Read more >Trial ID of the best model - Stack Overflow
I'm using Autokeras to find the best regression model and I need to plot ... #path for saving the logs import datetime %load_ext...
Read more >How to Use AutoKeras for Classification and Regression
The models and results are all saved in a folder called “structured_data_classifier” in your current working directory.
Read more >StructuredDataRegressor - AutoKeras
Defaults to 0.2. Fraction of the training data to be used as validation data. The model will set apart this fraction of the...
Read more >Complete guide to AutoKeras - Medium
Don't worry if all of this looks too overwhelming, you will get hold ... we can work with our model or save for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As I tested the latest version of AutoKeras can save the structureddataregressor fine.
@utkarshgupta137
save and load model
create: model_name - you select own name; directory - you select place for model’s data
save after creating: model_name - your selected name on previouse stage
save_pickle_model_to_file(model, model_name)