Please note that this needs to be set before importing TensorFlow and will set it for all packages in your Python runtime program.
import os os.environ['TF_USE_LEGACY_KERAS'] = '1'