Commit ccc60760 authored by Tomer Kaftan's avatar Tomer Kaftan Committed by A. Unique TensorFlower
Browse files

Pre-emptively disable the KerasTensors refactoring for the detection models in...

Pre-emptively disable the KerasTensors refactoring for the detection models in tensorflow models/official/vision/detection, because they rely on several unsupported things that will stop working entirely when the refactoring goes live.

Specifically:
* The custom layers implement `__call__` instead of `call` and rely on manually enter the keras backend graph
* The vision models try to use `tf.while_loop` as Keras op layers during functional API construction, which is unsupported.

Updating the models to avoid this would subtly change the variable names and break the pre-existing tf1-style name-based checkpoints, so for now we will just disable the KerasTensors refactoring for these models.

PiperOrigin-RevId: 323937426
parent 52504780
...@@ -23,6 +23,7 @@ from tensorflow.python.keras import backend ...@@ -23,6 +23,7 @@ from tensorflow.python.keras import backend
try: try:
from tensorflow.python.keras.engine import keras_tensor # pylint: disable=g-import-not-at-top,unused-import from tensorflow.python.keras.engine import keras_tensor # pylint: disable=g-import-not-at-top,unused-import
keras_tensor.disable_keras_tensors()
except ImportError: except ImportError:
keras_tensor = None keras_tensor = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment