File tree Expand file tree Collapse file tree 3 files changed +23
-5
lines changed
Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 2727# pylint: disable=g-direct-tensorflow-import
2828from tensorflow .python .framework import func_graph
2929from tensorflow .python .framework import ops
30- from tensorflow .python .training .tracking import base
31- # pylint: enable=g-direct-tensorflow-import
30+ # pylint: disable=g-import-not-at-top
31+ try :
32+ # Moved in TensorFlow 2.10.
33+ from tensorflow .python .trackable import base
34+ except ImportError :
35+ from tensorflow .python .training .tracking import base
36+ # pylint: enable=g-direct-tensorflow-import, g-import-not-at-top
3237
3338__all__ = ['annotate_asset' , 'make_and_track_object' ]
3439
Original file line number Diff line number Diff line change 1717from tensorflow_transform import annotators
1818from tensorflow_transform import test_case
1919
20- from tensorflow .python .training .tracking import base # pylint: disable=g-direct-tensorflow-import
20+ # pylint: disable=g-direct-tensorflow-import, g-import-not-at-top
21+ try :
22+ # Moved in TensorFlow 2.10.
23+ from tensorflow .python .trackable import base
24+ except ImportError :
25+ from tensorflow .python .training .tracking import base
26+ # pylint: enable=g-direct-tensorflow-import, g-import-not-at-top
2127
2228
2329class AnnotatorsTest (test_case .TransformTestCase ):
Original file line number Diff line number Diff line change 3030from tensorflow .python .eager import wrap_function
3131from tensorflow .python .framework import composite_tensor
3232from tensorflow .python .ops import lookup_ops
33- from tensorflow .python .training .tracking import tracking
3433from tensorflow .python .util import object_identity
35- # pylint: enable=g-direct-tensorflow-import
34+
35+ # pylint: disable=g-import-not-at-top
36+ try :
37+ # Moved in TensorFlow 2.10.
38+ from tensorflow .python .trackable import resource as tracking
39+ except ImportError :
40+ from tensorflow .python .training .tracking import tracking
41+
42+ # pylint: enable=g-direct-tensorflow-import, g-import-not-at-top
3643
3744
3845def _restore_from_v1_saved_model (
You can’t perform that action at this time.
0 commit comments