skjerns / AutoSleepScorerDev

file dump for training
GNU General Public License v3.0
8 stars 5 forks source link

Compiler show the UserWarning Update your `predict_generator` call to the Keras 2 API #8

Closed balandongiv closed 4 years ago

balandongiv commented 4 years ago

Hi Simon, Also, while on training, the compiler repeatedly issue the following warning

C:\Users\rpb\Documents\OneDrive - Universiti Teknologi PETRONAS\Code Development\sleep staging\keras_utils.py:349: UserWarning: Update your predict_generator call to the Keras 2 API: predict_generator(<keras_uti..., 3, max_queue_size=1) y_pred = np.array(self.model.predict_generator(self.gen, self.gen.n_batches, max_q_size=1)) C:\Users\rpb\anaconda3\envs\sleep staging\lib\site-packages\numpy\core\fromnumeric.py:3335: RuntimeWarning: Mean of empty slice. out=out, **kwargs) C:\Users\rpb\anaconda3\envs\sleep staging\lib\site-packages\numpy\core_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount)

Despite received this UserWarning for multiple time, the training is still able to continue until the end as indicated by the following report

No improvement after epoch 16.

I am just curious if the RuntimeWarning has serious implication?

Sorry to bugging you, I know this is an old project of yours. But among many example out there, yours is the one I am able to make it run up to the training phase.

skjerns commented 4 years ago

Indeed, the project is almost 5 years old. The warning should disappear when you install a version of keras<2, which was the original version I used.

I'm sorry but I think I cannot help you much more to debug the code :( of all I know it did run smoothly back in 2015. No improvement after epoch 16 should not be the case for the CNN, but might happen for the RNN

balandongiv commented 4 years ago

Thanks for the response.