EarlyStopping with restore_best_weights=True makes TypeError: 'NoneType' object is not subscriptable.
When restore_best_weights=False no exception.
System information
Stack trace:
File "/.../.venv/lib/python3.6/site-packages/keras/engine/training.py", line 1239, in fit
validation_freq=validation_freq)
File "/.../.venv/lib/python3.6/site-packages/keras/engine/training_arrays.py", line 216, in fit_loop
callbacks.on_epoch_end(epoch, epoch_logs)
File "/.../.venv/lib/python3.6/site-packages/keras/callbacks/callbacks.py", line 152, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "/.../.venv/lib/python3.6/site-packages/keras/callbacks/callbacks.py", line 834, in on_epoch_end
self.model.set_weights(self.best_weights)
File "/.../.venv/lib/python3.6/site-packages/keras/engine/network.py", line 516, in set_weights
own_weights = weights[:num_param]
TypeError: 'NoneType' object is not subscriptable
Process finished with exit code 1
i have same problem
Same problem running on Google Colab
Found the "problem".
It makes sense it is None because it found no better model than the baseline in my case.
I got rid of "baseline=1.0" and now it works.
Most helpful comment
i have same problem