Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickstart example throws warnings #298

Closed
dniku opened this issue Apr 28, 2019 · 5 comments
Closed

Quickstart example throws warnings #298

dniku opened this issue Apr 28, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@dniku
Copy link

dniku commented Apr 28, 2019

The quickstart example throws some warnings:

WARNING:tensorflow:From /path/to/stable-baselines/stable_baselines/common/policies.py:436: flatten (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.flatten instead.
WARNING:tensorflow:From /usr/lib/python3.7/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.
WARNING:tensorflow:From /usr/lib/python3.7/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.
WARNING:tensorflow:From /usr/lib/python3.7/site-packages/tensorflow/python/ops/math_grad.py:102: div (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Deprecated in favor of operator or tf.math.divide.

stable-baselines is installed from git commit 0eac3f5.

Here is the information collected by tf_env_collect.sh that seems relevant:

== uname -a =====================================================
Linux thamiel 4.19.34-1-MANJARO #1 SMP PREEMPT Sat Apr 6 08:28:55 UTC 2019 x86_64 GNU/Linux

== check pips ===================================================
numpy                             1.16.2    
protobuf                          3.7.0     
tensorflow                        1.13.1    
tensorflow-estimator              1.13.0    
tensorflow-serving-api            1.13.0    
tensorflow-serving-api-gpu        1.13.0

Also:

$ python --version
Python 3.7.3
@araffin araffin added the enhancement New feature or request label Apr 29, 2019
@araffin
Copy link
Collaborator

araffin commented Apr 29, 2019

Hello,
Thanks for pointing out deprecation warnings, some of them seem easy to solve (cast, divide), for others, we need to be careful or to upgrade the minimum tf version.

And for this one WARNING:tensorflow:From /usr/lib/python3.7/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: I don't where it does come from...

@araffin
Copy link
Collaborator

araffin commented May 5, 2019

Looking at the warnings again, they may come from tensorflow itself... see tensorflow/tensorflow#25996
so there is no way of fixing them from stable-baselines repo.

@araffin
Copy link
Collaborator

araffin commented Oct 30, 2019

Will be closed by #366

@araffin
Copy link
Collaborator

araffin commented Jun 2, 2020

as we are moving to PyTorch, this will probably not be fixed.
However, to remove the warnings, one can do:

# Filter tensorflow version warnings
import os
# https://stackoverflow.com/questions/40426502/is-there-a-way-to-suppress-the-messages-tensorflow-prints/40426709
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'  # or any {'0', '1', '2'}
import warnings
# https://stackoverflow.com/questions/15777951/how-to-suppress-pandas-future-warning
warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.simplefilter(action='ignore', category=Warning)
import tensorflow as tf
tf.get_logger().setLevel('INFO')
tf.autograph.set_verbosity(0)
import logging
tf.get_logger().setLevel(logging.ERROR)

@araffin araffin closed this as completed Jun 2, 2020
@nicola-pesavento
Copy link

For removing the Tensorflow's deprecation warnings it's possible to use the following code too:

import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)

(Source: tensorflow/tensorflow#27023 (comment) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants