-
Notifications
You must be signed in to change notification settings - Fork 51
Save TuneSearchCV object with tensorflow and keras models #249
Comments
Thanks for the report. As a workaround, can you try with cloudpickle? |
Thanks for the tip Yard1. But still don't work. With cloudpickle:
Error:
Error: |
Why do you need to save the TuneSearchCV object in the first place? What's the use case? Doesn't the model by itself suffice? |
You are complete right. Actually what I want is to save the refit trained model. But I do not know how either. |
You can obtain the best model by calling |
Thanks again Yard1. With I understand the porpoise of the CV like it is said here: But I suppose that the TuneSearchCV has the refit param for this porpoise and with this as I am in research and not in production this will save me the task of retrain the model with the best_params_ founds in the search. But perhaps this was not contemplated. |
The refit param merely specifies that the best estimator will be returned in its trained form. However, using best_params_ and refitting the estimator yourself is also a solution. |
I try with pickle, joblib and dill.
With pickle I had this error:
AttributeError: Can't pickle local object 'MaximumIterationStopper.__init__.<locals>.<lambda>'
With joblib I had this error:
raise PicklingError(_pickle.PicklingError: Can't pickle <function MaximumIterationStopper.__init__.<locals>.<lambda> at 0x7f3093158790>: it's not found as ray.tune.stopper.MaximumIterationStopper.__init__.<locals>.<lambda>
With dill I had this error:
TypeError: cannot pickle 'tensorflow.python._pywrap_tf_session.TF_Operation' object
I don't have defined any lambda function in my code. I suppose that the lambda function is inside the keras or tensorflow libraries.
The text was updated successfully, but these errors were encountered: