diff --git a/tf_keras/backend.py b/tf_keras/backend.py index 10be7741a..6fafafab7 100644 --- a/tf_keras/backend.py +++ b/tf_keras/backend.py @@ -2029,7 +2029,7 @@ def _create_seed(self, user_specified_seed): if user_specified_seed is not None: return user_specified_seed elif getattr(_SEED_GENERATOR, "generator", None): - return _SEED_GENERATOR.generator.randint(1, 1e9) + return _SEED_GENERATOR.generator.randint(1, int(1e9)) else: return random.randint(1, int(1e9)) diff --git a/tf_keras/utils/tf_utils.py b/tf_keras/utils/tf_utils.py index 3ce8d0cc8..032af7dce 100644 --- a/tf_keras/utils/tf_utils.py +++ b/tf_keras/utils/tf_utils.py @@ -78,9 +78,9 @@ def get_random_seed(): the random seed as an integer. """ if getattr(backend._SEED_GENERATOR, "generator", None): - return backend._SEED_GENERATOR.generator.randint(1, 1e9) + return backend._SEED_GENERATOR.generator.randint(1, int(1e9)) else: - return random.randint(1, 1e9) + return random.randint(1, int(1e9)) def is_tensor_or_tensor_list(v):