You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone
I am performing a hyperparameter tuning using a Keras tuner and for most of the trials it doesn’t generate a checkpoint; but for every trial, there is a file called trial(JSON file). Is it possible to create the model out of the JSON file? I tried to extract the hyperparameters successfully but I couldn’t generate the model out of it and I got the following error.
Cell In[8], line 1
trial_model = tuner_bo.hypermodel.build(hyperparameters)
File c:\users\geerthy\ejection fraction project\echo_codes\tunermr_ef_median_2l_earlyfusion_with_fc.py:69 in build
fl_1 = hp.Choice('n_fil_1', values = [2,4, 8, 16, 32, 64])
AttributeError: 'dict' object has no attribute 'Choice`
Here’s how I call it
best_trials = tuner_bo.oracle.get_best_trials(num_trials=50)
for i in range(0, len(best_trials), 50):
for j in range(i, min(i + 50, len(best_trials))):
trial = best_trials[j]
hyperparameters = trial.hyperparameters.values
# Train the model with the best hyperparameters
trial_model = tuner_bo.hypermodel.build(hyperparameters)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone
I am performing a hyperparameter tuning using a Keras tuner and for most of the trials it doesn’t generate a checkpoint; but for every trial, there is a file called trial(JSON file). Is it possible to create the model out of the JSON file? I tried to extract the hyperparameters successfully but I couldn’t generate the model out of it and I got the following error.
Here’s how I call it
Here’s my model class :
Any suggestions would be helpful
Thank you
Beta Was this translation helpful? Give feedback.
All reactions