tensorflow中keep_prob的修改方法

tensorflow中keep_prob的修改方法

warning:

WARNING:tensorflow:From D:\software\pycharm_location\venv\Dehaze-GAN-master\Dehaze-GAN-master\legacy\utils.py:67: 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`.

源码:

h_fc1_drop = tf.nn.dropout(h_fc1,keep_prob)

修改为:

h_fc1_drop = tf.nn.dropout(h_fc1, rate = 1-keep_prob)

版权声明:本文为weixin_44493841原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。