Saving a model after a warm start
See original GitHub issueI am using the below code to fit a model using a warm start. which calls the below function to write the model to file. I am able to save the initial model without any issues. However, when I come to try and save a model after a warm start (that is essentially two models that have been combined) I get the below error:
Object of type ndarray is not JSON serializable
from the json.dump(model_to_json(model)
code.
Can anyone help, this is quite urgent. Thank you!
` m_current = read_model_from_cloud(userId, containerId, tagId)
m = Prophet.Prophet(daily_seasonality='auto',
yearly_seasonality='auto',
weekly_seasonality='auto',
interval_width=interval_width,
changepoint_range=0.8)
if m_current is not None:
m = m.fit(df, init=stan_init(m_current))
else:
m = m.fit(df)
upload_model_to_cloud(m,
userId,
containerId,
tagId,
lastRun)`
with open(model_name, 'w') as fout: json.dump(model_to_json(model), fout)
The issue seems to be with the model_to_json
function
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Save and load models | TensorFlow Core
Model progress can be saved during and after training. This means a model can resume where it left off and avoid long training...
Read more >Warm starting for efficient deep learning resource utilization
In this post, we discuss how warm-starting can save computational resources and improve generalizability when training deep learning models.
Read more >Keras: How to save model and continue training?
read()) # open the model you just saved (same as your last train) with a different name old_model.load_weights('yours.h5') # the model ...
Read more >How to Save and Load Your Keras Deep Learning Model
You can save your model by calling the save() function on the model and specifying the filename. The example below demonstrates this by...
Read more >Save solution and warm start - Julia Discourse
I am using JuMP and CPLEX to solve an optimization problem. How can I save the best solution found after a certain time...
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
This is fixed in 29f1417.
test code:
Using the debugger, I found two fields “delta” and “beta” which remain in the ndarray format. Convert them to a list format manually before calling the “model_to_json” method.