Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tensorflow: Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`

Tags:

I get this warning most of the time when i define a model using Keras. It seems to somehow come from tensorflow though:

WARNING:tensorflow:From C:\Users\lenik\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\backend\tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version. Instructions for updating: Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`. 

Is this warning something to worry about? If yes, how do i solve this problem?

like image 440
lenikhilsingh Avatar asked Mar 19 '19 06:03

lenikhilsingh


2 Answers

This depreciation warning is due to the Dropout layer in tf.keras.layers.Dropout.
To avoid this warning, you need to clearly specify rate= in Dropout as: Dropout(rate=0.2).

Earlier it was keep_prob and it is now deprecated to rate i.e. rate = 1-keep_prob.
For more, you can check out this tensorflow documentation.

like image 125
xanjay Avatar answered Sep 25 '22 10:09

xanjay


Tensorflow is telling you that the argument keep_prob is deprecated and that it has been replaced by the argument rate.

Now, to achieve the same behavior you have now and remove the warning, you need to replace every occurrence of the keep_prob argument with rate argument, and pass the value 1-keep_prob.

like image 20
Neb Avatar answered Sep 24 '22 10:09

Neb