走进tensorflow第九步——WARNING(警告)也值得关注

       在github上down了几个神经网络的工程,遇到不少问题,很多都是用的已训练好的模型进行的再加工,五花八门,给的链接大多数都不能用,之前刚配好环境,选择又得debug了……

       先整几个今天遇到的warning吧,都是过期用法的问题:

1.

WARNING:tensorflow:From D:\Anaconda\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.

Instructions for updating:

Colocations handled automatically by placer.

2.

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`.

3.

WARNING:tensorflow:From D:\Anaconda\lib\site-packages\tensorflow\python\ops\losses\losses_impl.py:667: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.

Instructions for updating:

Use tf.cast instead.

4.

WARNING:tensorflow:From D:\Anaconda\lib\site-packages\tensorflow\python\ops\math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.

Instructions for updating:

Use tf.cast instead.

5.

WARNING:tensorflow:From D:\Anaconda\lib\site-packages\tensorflow\python\training\saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.

Instructions for updating:

Use standard file APIs to check for files with this prefix.

看来得与时俱进啊,很多老的用法慢慢地就需要更新了,可以根据提示的路径找到对应的文件进行修改(红色部分为相应的解决方案),如:

1.

修改为:

2.

修改为:

3.

修改为:

在官方文档中也有相应的说明:

 

这些警告不会影响程序的运行,但关注一下会使得程序更加标准,也减少了视觉冲击……