Skip to content

Commit 0c6999a

Browse files
authored
Merge pull request #288 from kAIto47802/support-python3.12
Add checking for python3.12
2 parents d4ed01d + 6ccb8d4 commit 0c6999a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

tensorflow/tensorflow_estimator_integration.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"""
1313

1414
import shutil
15+
import sys
1516
import tempfile
1617
import urllib
1718

@@ -133,4 +134,11 @@ def main():
133134

134135

135136
if __name__ == "__main__":
137+
if sys.version_info >= (3, 12):
138+
raise RuntimeError(
139+
"Use `optuna_integration.KerasPruningCallback` instead, "
140+
"because TensorFlow recommends migrating from Estimator to Keras APIs. "
141+
"For more details, please check the TensorFlow migration guide: "
142+
"https://www.tensorflow.org/guide/migrate/migrating_estimator"
143+
)
136144
main()

tensorflow/tensorflow_estimator_simple.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"""
1010

1111
import shutil
12+
import sys
1213
import tempfile
1314
import urllib
1415

@@ -123,4 +124,10 @@ def main():
123124

124125

125126
if __name__ == "__main__":
127+
if sys.version_info >= (3, 12):
128+
raise RuntimeError(
129+
"Use Keras APIs instead of Estimator API in TensorFlow. "
130+
"For more details, please check the TensorFlow migration guide: "
131+
"https://www.tensorflow.org/guide/migrate/migrating_estimator"
132+
)
126133
main()

0 commit comments

Comments
 (0)