Open iaioanno opened 2 years ago
Flagged with Ayush + Soumik
I have the exact same issue. I'm using Google Drive as the directory and I can see it creates files, but not a "checkpoint" folder. Did you resolve this?
Would a workaround be to just use get_best_hyperparameters(num_trials=1)[0]
and build a model with those values?
The issue, as best I can tell comes from the current version of TensorFlow and Keras_Tuner. Somewhere between TF 2.3 and 2.9 something changed (I've been looking but I'm not good enough to find it) that causes an incompatibility when calling get_best_models().
Would a workaround be to just use
get_best_hyperparameters(num_trials=1)[0]
and build a model with those values?
That is what was done under the hood of get_best_models()
.
I was able to workaround this issue under Keras Tuner v.1.3.5 and Tensorflow v. 2.12.0, however unfortunately not solving the missing checkpoints. I subclassed Tuner.run_trial() by overriding keras_tuner.Tuner as in the documentation and added there the implementation of tuner_utils.SaveBestEpoch() from keras_tuner.Tuner.
The relevant part to make the call of MyTuner.get_best_models() working was as follows in the Tuner subclass "MyTuner":
checkpoint=tuner_utils.SaveBestEpoch(objective=self.oracle.objective, filepath=self._get_checkpoint_fname(trial.trial_id)) checkpoint.set_model(yourBuiltmodel) checkpoint._save_model()
I hope this might help you.
Hello, i have an issue when trying to create my custom tuner through the tuner class in order to upload the model hyperparameters at Weights and Biases site.
Even though everything seems to be working fine with the upload of each model, i get an error when I’m trying to get_best_models()
I would appreciate your help a lot!
Here is the tuner class I’m trying to create
Now when i try to use the tuner for tuner.search() everything works fine, but when i get to get_best_models() i get an error
The error message is: NotFoundError: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for DAM_Aggr_tuning_129_cc\DAM_Aggr_tuning_129_cc_project\trial_3\checkpoint
here is also my github folder in case you want to see the full code https://github.com/iaioanno/WandB/tree/main/HUB
If anyone could help me it would be amazing, thank you.