[RLlib] Remove all remaining tf- and MuJoCo warnings from RLlib. (#15454)

This commit is contained in:
Sven Mika 2021-04-22 19:20:19 +02:00 committed by GitHub
parent baa1b0f360
commit 7e1a191f17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -30,6 +30,9 @@ try:
except ImportError:
specs = None
try:
# Suppress MuJoCo warning (dm_control uses absl logging).
import absl.logging
absl.logging.set_verbosity("error")
from dm_control import suite
except (ImportError, OSError):
suite = None

View file

@ -87,9 +87,11 @@ def try_import_tf(error=False):
# Try "reducing" tf to tf.compat.v1.
try:
tf1_module = tf_module.compat.v1
tf1_module.logging.set_verbosity(tf1_module.logging.ERROR)
if not was_imported:
tf1_module.disable_v2_behavior()
tf1_module.enable_resource_variables()
tf1_module.logging.set_verbosity(tf1_module.logging.WARN)
# No compat.v1 -> return tf as is.
except AttributeError:
tf1_module = tf_module