Skip to content

Commit

Permalink
Add version check
Browse files Browse the repository at this point in the history
  • Loading branch information
kAIto47802 committed Oct 25, 2024
1 parent e7b117c commit d8ef118
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tensorflow/tensorflow_estimator_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"""

import shutil
import sys
import tempfile
import urllib

Expand Down Expand Up @@ -133,4 +134,11 @@ def main():


if __name__ == "__main__":
if sys.version_info >= (3, 12):
raise RuntimeError(
"Use `optuna_integration.KerasPruningCallback` instead, "
"because TensorFlow recommends migrating from Estimator to Keras APIs. "
"For more details, please check the TensorFlow migration guide: "
"https://www.tensorflow.org/guide/migrate/migrating_estimator"
)
main()
7 changes: 7 additions & 0 deletions tensorflow/tensorflow_estimator_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import shutil
import tempfile
import urllib
import sys

import optuna
from packaging import version
Expand Down Expand Up @@ -123,4 +124,10 @@ def main():


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

0 comments on commit d8ef118

Please sign in to comment.