keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
61.88k stars 19.45k forks source link

Results are not reproducible with adam / rmsprop optimizer #13921

Closed Arktius closed 4 years ago

Arktius commented 4 years ago

Hi folks, I'm training lots of models and try to optimize certain hyperparameters. After running the code several times, I noticed that I get different results(RMSE accuracy) when using the adam or rmsprop optimizer. The RMSE usually lies between 0 and 1. The model is a deep Autoencoder which tries to fill missing values. Missing values are represented by zeros. I've mapped 20% of my data to zero. So it's job is to reconstruct the 20%.

System information
Windows 10 Microsoft Windows [Version 10.0.18362.418]

Describe the current behavior
When I train a model with either the adam or rmsprop optimizer, I get different results with each run. Random seed is set exactly before creating the model. Other optimizers work flawlessly .

What I've tested so far:

Further information:

Arktius commented 4 years ago

import os os.environ['TF_CUDNN_DETERMINISTIC'] = 'true' os.environ['TF_DETERMINISTIC_OPS'] = 'true'

Found the solution in this video

Deep Learning Determinism - NVIDIA