Avoid tf deprecation warning (#1148)

main
zhiltsov-max 6 years ago committed by GitHub
parent 15dc61dd38
commit a2da181f01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,12 +26,15 @@ def import_tf():
pass pass
# Enable eager execution in early versions to unlock dataset operations # Enable eager execution in early versions to unlock dataset operations
eager_enabled = False
try: try:
tf.compat.v1.enable_eager_execution() tf.compat.v1.enable_eager_execution()
eager_enabled = True
except AttributeError: except AttributeError:
pass pass
try: try:
tf.enable_eager_execution() if not eager_enabled:
tf.enable_eager_execution()
except AttributeError: except AttributeError:
pass pass

Loading…
Cancel
Save