optkeras icon indicating copy to clipboard operation
optkeras copied to clipboard

colab notebook default example error

Open cerlymarco opened this issue 4 years ago • 0 comments

I run the link of your colab notebook as is and I receive the following AssertionError at every run

[W 2020-07-02 16:28:05,165] Setting status of trial#0 as TrialState.FAIL because of the following error: AssertionError('[OptKeras] Monitor variable needs to be in the logs dictionary. Use a callback.',)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/optuna/study.py", line 469, in _run_trial
    result = func(trial)
  File "/usr/local/lib/python3.6/dist-packages/optkeras/optkeras.py", line 130, in fun_tf
    return fun(trial)
  File "<ipython-input-6-acfc70c5c697>", line 41, in objective
    verbose=ok.keras_verbose )
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 1239, in fit
    validation_freq=validation_freq)
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/training_arrays.py", line 216, in fit_loop
    callbacks.on_epoch_end(epoch, epoch_logs)
  File "/usr/local/lib/python3.6/dist-packages/keras/callbacks/callbacks.py", line 152, in on_epoch_end
    callback.on_epoch_end(epoch, logs)
  File "/usr/local/lib/python3.6/dist-packages/optkeras/optkeras.py", line 300, in on_epoch_end
    assert self.monitor in logs, '[OptKeras] Monitor variable needs to be in the logs dictionary. Use a callback.'
AssertionError: [OptKeras] Monitor variable needs to be in the logs dictionary. Use a callback.

it simply doesn't optimize anything

cerlymarco avatar Jul 02 '20 16:07 cerlymarco