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
# Enable eager execution in early versions to unlock dataset operations
eager_enabled = False
try:
tf.compat.v1.enable_eager_execution()
eager_enabled = True
except AttributeError:
pass
try:
tf.enable_eager_execution()
if not eager_enabled:
tf.enable_eager_execution()
except AttributeError:
pass

Loading…
Cancel
Save