Repository: keras-team/keras-tuner (language: python)

Issue:
keras-tuner on tensorflow 2.12
keras-tuner==1.3.0 returns an error after upgrading tensorflow to 2.12:

```
>>> import keras_tuner
.
.
.
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
```
In tf==2.12, protobuf upgraded to 4.2 (from 3.19 in tf~=2.11)
However, downgrading to protobuf~=3.20 fixed the problem.

I'm sorry that I didn't include the full error but pretty sure that you can quickly regenerate it.


Discussion / hints:
Thanks for the issue, @imanbabaei!
I am working on fixing it.

Fix patch:
diff --git a/RELEASE.md b/RELEASE.md
index 403491e0c..e90480900 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -4,7 +4,9 @@
 * The `Tuner.results_summary()` did not print error messages for failed trials
   and did not display `Objective` information correctly. It is now fixed.
 * The `BayesianOptimization` would break when not specifying the
-* `num_initial_points` and overriding `.run_trial()`. It is now fixed.
+  `num_initial_points` and overriding `.run_trial()`. It is now fixed.
+* TensorFlow 2.12 would break because the different protobuf version. It is now
+  fixed.
 
 # Release v1.3.0
 
diff --git a/keras_tuner/distribute/oracle_chief.py b/keras_tuner/distribute/oracle_chief.py
index 08fe643e5..9adc1c269 100644
--- a/keras_tuner/distribute/oracle_chief.py
+++ b/keras_tuner/distribute/oracle_chief.py
@@ -45,11 +45,10 @@ def CreateTrial(self, request, context):
         return service_pb2.CreateTrialResponse(trial=trial.to_proto())
 
     def UpdateTrial(self, request, context):
-        status = self.oracle.update_trial(
+        trial = self.oracle.update_trial(
             request.trial_id, request.metrics, step=request.step
         )
-        status_proto = trial_module.TrialStatus.to_proto(status)
-        return service_pb2.UpdateTrialResponse(status=status_proto)
+        return service_pb2.UpdateTrialResponse(trial=trial.to_proto())
 
     def EndTrial(self, request, context):
         trial = trial_module.Trial.from_proto(request.trial)
diff --git a/keras_tuner/distribute/oracle_client.py b/keras_tuner/distribute/oracle_client.py
index 55790b58a..e8b37af90 100644
--- a/keras_tuner/distribute/oracle_client.py
+++ b/keras_tuner/distribute/oracle_client.py
@@ -83,8 +83,8 @@ def update_trial(self, trial_id, metrics, step=0):
                 wait_for_ready=True,
             )
             if not self.multi_worker:
-                return trial_module.TrialStatus.from_proto(response.status)
-        return "RUNNING"
+                return trial_module.Trial.from_proto(response.trial)
+        return trial_module.Trial(self.get_space(), status="RUNNING")
 
     def end_trial(self, trial):
         if self.should_report:
diff --git a/keras_tuner/engine/oracle.py b/keras_tuner/engine/oracle.py
index e72d4bbf7..6f0d124ea 100644
--- a/keras_tuner/engine/oracle.py
+++ b/keras_tuner/engine/oracle.py
@@ -371,7 +371,7 @@ def update_trial(self, trial_id, metrics, step=0):
             trial.metrics.update(metric_name, metric_value, step=step)
         self._save_trial(trial)
         # TODO: To signal early stopping, set Trial.status to "STOPPED".
-        return trial.status
+        return trial
 
     def _check_consecutive_failures(self):
         # For thread safety, check all trials for consecutive failures.
diff --git a/keras_tuner/protos/keras_tuner_pb2.py b/keras_tuner/protos/keras_tuner_pb2.py
index 2a8ea3df1..c5825f939 100644
--- a/keras_tuner/protos/keras_tuner_pb2.py
+++ b/keras_tuner/protos/keras_tuner_pb2.py
@@ -16,9 +16,6 @@
 # Generated by the protocol buffer compiler.  DO NOT EDIT!
 # source: keras_tuner/protos/keras_tuner.proto
 
-import sys
-
-_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
 from google.protobuf.internal import enum_type_wrapper
 from google.protobuf import descriptor as _descriptor
 from google.protobuf import message as _message
@@ -35,9 +32,8 @@
     package="keras_tuner",
     syntax="proto3",
     serialized_options=None,
-    serialized_pb=_b(
-        '\n$keras_tuner/protos/keras_tuner.proto\x12\x0bkeras_tuner"l\n\x05Value\x12\x13\n\tint_value\x18\x01 \x01(\x12H\x00\x12\x15\n\x0b\x66loat_value\x18\x02 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x03 \x01(\tH\x00\x12\x17\n\rboolean_value\x18\x04 \x01(\x08H\x00\x42\x06\n\x04kind"\xaf\x01\n\x05\x46loat\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tmin_value\x18\x02 \x01(\x01\x12\x11\n\tmax_value\x18\x03 \x01(\x01\x12\x0c\n\x04step\x18\x04 \x01(\x01\x12\'\n\x08sampling\x18\x05 \x01(\x0e\x32\x15.keras_tuner.Sampling\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x06 \x01(\x01\x12*\n\nconditions\x18\x07 \x03(\x0b\x32\x16.keras_tuner.Condition"\xad\x01\n\x03Int\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tmin_value\x18\x02 \x01(\x12\x12\x11\n\tmax_value\x18\x03 \x01(\x12\x12\x0c\n\x04step\x18\x04 \x01(\x12\x12\'\n\x08sampling\x18\x05 \x01(\x0e\x32\x15.keras_tuner.Sampling\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x06 \x01(\x12\x12*\n\nconditions\x18\x07 \x03(\x0b\x32\x16.keras_tuner.Condition"\x9c\x01\n\x06\x43hoice\x12\x0c\n\x04name\x18\x01 \x01(\t\x12"\n\x06values\x18\x02 \x03(\x0b\x32\x12.keras_tuner.Value\x12#\n\x07\x64\x65\x66\x61ult\x18\x03 \x01(\x0b\x32\x12.keras_tuner.Value\x12\x0f\n\x07ordered\x18\x04 \x01(\x08\x12*\n\nconditions\x18\x05 \x03(\x0b\x32\x16.keras_tuner.Condition"T\n\x07\x42oolean\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x02 \x01(\x08\x12*\n\nconditions\x18\x03 \x03(\x0b\x32\x16.keras_tuner.Condition"d\n\x05\x46ixed\x12\x0c\n\x04name\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.keras_tuner.Value\x12*\n\nconditions\x18\x03 \x03(\x0b\x32\x16.keras_tuner.Condition"\xe1\x03\n\x0fHyperParameters\x12\x31\n\x05space\x18\x01 \x01(\x0b\x32".keras_tuner.HyperParameters.Space\x12\x33\n\x06values\x18\x02 \x01(\x0b\x32#.keras_tuner.HyperParameters.Values\x1a\xd6\x01\n\x05Space\x12\'\n\x0b\x66loat_space\x18\x01 \x03(\x0b\x32\x12.keras_tuner.Float\x12#\n\tint_space\x18\x02 \x03(\x0b\x32\x10.keras_tuner.Int\x12)\n\x0c\x63hoice_space\x18\x03 \x03(\x0b\x32\x13.keras_tuner.Choice\x12+\n\rboolean_space\x18\x04 \x03(\x0b\x32\x14.keras_tuner.Boolean\x12\'\n\x0b\x66ixed_space\x18\x05 \x03(\x0b\x32\x12.keras_tuner.Fixed\x1a\x8c\x01\n\x06Values\x12?\n\x06values\x18\x01 \x03(\x0b\x32/.keras_tuner.HyperParameters.Values.ValuesEntry\x1a\x41\n\x0bValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.keras_tuner.Value:\x02\x38\x01"0\n\x11MetricObservation\x12\r\n\x05value\x18\x01 \x03(\x02\x12\x0c\n\x04step\x18\x02 \x01(\x03"W\n\rMetricHistory\x12\x34\n\x0cobservations\x18\x01 \x03(\x0b\x32\x1e.keras_tuner.MetricObservation\x12\x10\n\x08maximize\x18\x02 \x01(\x08"\x97\x01\n\x0eMetricsTracker\x12\x39\n\x07metrics\x18\x01 \x03(\x0b\x32(.keras_tuner.MetricsTracker.MetricsEntry\x1aJ\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.keras_tuner.MetricHistory:\x02\x38\x01"\xf7\x01\n\x05Trial\x12\x35\n\x0fhyperparameters\x18\x01 \x01(\x0b\x32\x1c.keras_tuner.HyperParameters\x12\x10\n\x08trial_id\x18\x02 \x01(\t\x12(\n\x06status\x18\x03 \x01(\x0e\x32\x18.keras_tuner.TrialStatus\x12,\n\x07metrics\x18\x04 \x01(\x0b\x32\x1b.keras_tuner.MetricsTracker\x12\'\n\x05score\x18\x05 \x01(\x0b\x32\x18.keras_tuner.Trial.Score\x1a$\n\x05Score\x12\r\n\x05value\x18\x01 \x01(\x02\x12\x0c\n\x04step\x18\x02 \x01(\x03"\x80\x01\n\tCondition\x12/\n\x06parent\x18\x01 \x01(\x0b\x32\x1d.keras_tuner.Condition.ParentH\x00\x1a:\n\x06Parent\x12\x0c\n\x04name\x18\x01 \x01(\t\x12"\n\x06values\x18\x02 \x03(\x0b\x32\x12.keras_tuner.ValueB\x06\n\x04kind*:\n\x08Sampling\x12\x08\n\x04NONE\x10\x00\x12\n\n\x06LINEAR\x10\x01\x12\x07\n\x03LOG\x10\x02\x12\x0f\n\x0bREVERSE_LOG\x10\x03*f\n\x0bTrialStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\x08\n\x04IDLE\x10\x02\x12\x0b\n\x07INVALID\x10\x03\x12\x0b\n\x07STOPPED\x10\x04\x12\r\n\tCOMPLETED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x62\x06proto3'
-    ),
+    create_key=_descriptor._internal_create_key,
+    serialized_pb=b'\n$keras_tuner/protos/keras_tuner.proto\x12\x0bkeras_tuner"l\n\x05Value\x12\x13\n\tint_value\x18\x01 \x01(\x12H\x00\x12\x15\n\x0b\x66loat_value\x18\x02 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x03 \x01(\tH\x00\x12\x17\n\rboolean_value\x18\x04 \x01(\x08H\x00\x42\x06\n\x04kind"\xaf\x01\n\x05\x46loat\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tmin_value\x18\x02 \x01(\x01\x12\x11\n\tmax_value\x18\x03 \x01(\x01\x12\x0c\n\x04step\x18\x04 \x01(\x01\x12\'\n\x08sampling\x18\x05 \x01(\x0e\x32\x15.keras_tuner.Sampling\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x06 \x01(\x01\x12*\n\nconditions\x18\x07 \x03(\x0b\x32\x16.keras_tuner.Condition"\xad\x01\n\x03Int\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tmin_value\x18\x02 \x01(\x12\x12\x11\n\tmax_value\x18\x03 \x01(\x12\x12\x0c\n\x04step\x18\x04 \x01(\x12\x12\'\n\x08sampling\x18\x05 \x01(\x0e\x32\x15.keras_tuner.Sampling\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x06 \x01(\x12\x12*\n\nconditions\x18\x07 \x03(\x0b\x32\x16.keras_tuner.Condition"\x9c\x01\n\x06\x43hoice\x12\x0c\n\x04name\x18\x01 \x01(\t\x12"\n\x06values\x18\x02 \x03(\x0b\x32\x12.keras_tuner.Value\x12#\n\x07\x64\x65\x66\x61ult\x18\x03 \x01(\x0b\x32\x12.keras_tuner.Value\x12\x0f\n\x07ordered\x18\x04 \x01(\x08\x12*\n\nconditions\x18\x05 \x03(\x0b\x32\x16.keras_tuner.Condition"T\n\x07\x42oolean\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x02 \x01(\x08\x12*\n\nconditions\x18\x03 \x03(\x0b\x32\x16.keras_tuner.Condition"d\n\x05\x46ixed\x12\x0c\n\x04name\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.keras_tuner.Value\x12*\n\nconditions\x18\x03 \x03(\x0b\x32\x16.keras_tuner.Condition"\xe1\x03\n\x0fHyperParameters\x12\x31\n\x05space\x18\x01 \x01(\x0b\x32".keras_tuner.HyperParameters.Space\x12\x33\n\x06values\x18\x02 \x01(\x0b\x32#.keras_tuner.HyperParameters.Values\x1a\xd6\x01\n\x05Space\x12\'\n\x0b\x66loat_space\x18\x01 \x03(\x0b\x32\x12.keras_tuner.Float\x12#\n\tint_space\x18\x02 \x03(\x0b\x32\x10.keras_tuner.Int\x12)\n\x0c\x63hoice_space\x18\x03 \x03(\x0b\x32\x13.keras_tuner.Choice\x12+\n\rboolean_space\x18\x04 \x03(\x0b\x32\x14.keras_tuner.Boolean\x12\'\n\x0b\x66ixed_space\x18\x05 \x03(\x0b\x32\x12.keras_tuner.Fixed\x1a\x8c\x01\n\x06Values\x12?\n\x06values\x18\x01 \x03(\x0b\x32/.keras_tuner.HyperParameters.Values.ValuesEntry\x1a\x41\n\x0bValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.keras_tuner.Value:\x02\x38\x01"0\n\x11MetricObservation\x12\r\n\x05value\x18\x01 \x03(\x02\x12\x0c\n\x04step\x18\x02 \x01(\x03"W\n\rMetricHistory\x12\x34\n\x0cobservations\x18\x01 \x03(\x0b\x32\x1e.keras_tuner.MetricObservation\x12\x10\n\x08maximize\x18\x02 \x01(\x08"\x97\x01\n\x0eMetricsTracker\x12\x39\n\x07metrics\x18\x01 \x03(\x0b\x32(.keras_tuner.MetricsTracker.MetricsEntry\x1aJ\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.keras_tuner.MetricHistory:\x02\x38\x01"\xf7\x01\n\x05Trial\x12\x35\n\x0fhyperparameters\x18\x01 \x01(\x0b\x32\x1c.keras_tuner.HyperParameters\x12\x10\n\x08trial_id\x18\x02 \x01(\t\x12(\n\x06status\x18\x03 \x01(\x0e\x32\x18.keras_tuner.TrialStatus\x12,\n\x07metrics\x18\x04 \x01(\x0b\x32\x1b.keras_tuner.MetricsTracker\x12\'\n\x05score\x18\x05 \x01(\x0b\x32\x18.keras_tuner.Trial.Score\x1a$\n\x05Score\x12\r\n\x05value\x18\x01 \x01(\x02\x12\x0c\n\x04step\x18\x02 \x01(\x03"\x80\x01\n\tCondition\x12/\n\x06parent\x18\x01 \x01(\x0b\x32\x1d.keras_tuner.Condition.ParentH\x00\x1a:\n\x06Parent\x12\x0c\n\x04name\x18\x01 \x01(\t\x12"\n\x06values\x18\x02 \x03(\x0b\x32\x12.keras_tuner.ValueB\x06\n\x04kind*:\n\x08Sampling\x12\x08\n\x04NONE\x10\x00\x12\n\n\x06LINEAR\x10\x01\x12\x07\n\x03LOG\x10\x02\x12\x0f\n\x0bREVERSE_LOG\x10\x03*f\n\x0bTrialStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\x08\n\x04IDLE\x10\x02\x12\x0b\n\x07INVALID\x10\x03\x12\x0b\n\x07STOPPED\x10\x04\x12\r\n\tCOMPLETED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x62\x06proto3',
 )
 
 _SAMPLING = _descriptor.EnumDescriptor(
@@ -45,15 +41,31 @@
     full_name="keras_tuner.Sampling",
     filename=None,
     file=DESCRIPTOR,
+    create_key=_descriptor._internal_create_key,
     values=[
         _descriptor.EnumValueDescriptor(
-            name="NONE", index=0, number=0, serialized_options=None, type=None
+            name="NONE",
+            index=0,
+            number=0,
+            serialized_options=None,
+            type=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.EnumValueDescriptor(
-            name="LINEAR", index=1, number=1, serialized_options=None, type=None
+            name="LINEAR",
+            index=1,
+            number=1,
+            serialized_options=None,
+            type=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.EnumValueDescriptor(
-            name="LOG", index=2, number=2, serialized_options=None, type=None
+            name="LOG",
+            index=2,
+            number=2,
+            serialized_options=None,
+            type=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.EnumValueDescriptor(
             name="REVERSE_LOG",
@@ -61,6 +73,7 @@
             number=3,
             serialized_options=None,
             type=None,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     containing_type=None,
@@ -76,6 +89,7 @@
     full_name="keras_tuner.TrialStatus",
     filename=None,
     file=DESCRIPTOR,
+    create_key=_descriptor._internal_create_key,
     values=[
         _descriptor.EnumValueDescriptor(
             name="UNKNOWN",
@@ -83,6 +97,7 @@
             number=0,
             serialized_options=None,
             type=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.EnumValueDescriptor(
             name="RUNNING",
@@ -90,9 +105,15 @@
             number=1,
             serialized_options=None,
             type=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.EnumValueDescriptor(
-            name="IDLE", index=2, number=2, serialized_options=None, type=None
+            name="IDLE",
+            index=2,
+            number=2,
+            serialized_options=None,
+            type=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.EnumValueDescriptor(
             name="INVALID",
@@ -100,6 +121,7 @@
             number=3,
             serialized_options=None,
             type=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.EnumValueDescriptor(
             name="STOPPED",
@@ -107,6 +129,7 @@
             number=4,
             serialized_options=None,
             type=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.EnumValueDescriptor(
             name="COMPLETED",
@@ -114,9 +137,15 @@
             number=5,
             serialized_options=None,
             type=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.EnumValueDescriptor(
-            name="FAILED", index=6, number=6, serialized_options=None, type=None
+            name="FAILED",
+            index=6,
+            number=6,
+            serialized_options=None,
+            type=None,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     containing_type=None,
@@ -146,6 +175,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="int_value",
@@ -164,6 +194,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="float_value",
@@ -182,6 +213,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="string_value",
@@ -192,7 +224,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -200,6 +232,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="boolean_value",
@@ -218,6 +251,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -233,6 +267,7 @@
             full_name="keras_tuner.Value.kind",
             index=0,
             containing_type=None,
+            create_key=_descriptor._internal_create_key,
             fields=[],
         ),
     ],
@@ -247,6 +282,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="name",
@@ -257,7 +293,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -265,6 +301,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="min_value",
@@ -283,6 +320,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="max_value",
@@ -301,6 +339,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="step",
@@ -319,6 +358,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="sampling",
@@ -337,6 +377,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="default",
@@ -355,6 +396,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="conditions",
@@ -373,6 +415,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -394,6 +437,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="name",
@@ -404,7 +448,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -412,6 +456,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="min_value",
@@ -430,6 +475,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="max_value",
@@ -448,6 +494,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="step",
@@ -466,6 +513,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="sampling",
@@ -484,6 +532,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="default",
@@ -502,6 +551,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="conditions",
@@ -520,6 +570,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -541,6 +592,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="name",
@@ -551,7 +603,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -559,6 +611,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="values",
@@ -577,6 +630,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="default",
@@ -595,6 +649,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="ordered",
@@ -613,6 +668,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="conditions",
@@ -631,6 +687,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -652,6 +709,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="name",
@@ -662,7 +720,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -670,6 +728,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="default",
@@ -688,6 +747,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="conditions",
@@ -706,6 +766,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -727,6 +788,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="name",
@@ -737,7 +799,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -745,6 +807,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="value",
@@ -763,6 +826,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="conditions",
@@ -781,6 +845,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -802,6 +867,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="float_space",
@@ -820,6 +886,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="int_space",
@@ -838,6 +905,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="choice_space",
@@ -856,6 +924,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="boolean_space",
@@ -874,6 +943,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="fixed_space",
@@ -892,6 +962,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -912,6 +983,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="key",
@@ -922,7 +994,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -930,6 +1002,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="value",
@@ -948,12 +1021,13 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
     nested_types=[],
     enum_types=[],
-    serialized_options=_b("8\001"),
+    serialized_options=b"8\001",
     is_extendable=False,
     syntax="proto3",
     extension_ranges=[],
@@ -968,6 +1042,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="values",
@@ -986,6 +1061,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -1008,6 +1084,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="space",
@@ -1026,6 +1103,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="values",
@@ -1044,6 +1122,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -1068,6 +1147,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="value",
@@ -1086,6 +1166,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="step",
@@ -1104,6 +1185,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -1125,6 +1207,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="observations",
@@ -1143,6 +1226,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="maximize",
@@ -1161,6 +1245,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -1182,6 +1267,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="key",
@@ -1192,7 +1278,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -1200,6 +1286,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="value",
@@ -1218,12 +1305,13 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
     nested_types=[],
     enum_types=[],
-    serialized_options=_b("8\001"),
+    serialized_options=b"8\001",
     is_extendable=False,
     syntax="proto3",
     extension_ranges=[],
@@ -1238,6 +1326,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="metrics",
@@ -1256,6 +1345,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -1279,6 +1369,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="value",
@@ -1297,6 +1388,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="step",
@@ -1315,6 +1407,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -1335,6 +1428,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="hyperparameters",
@@ -1353,6 +1447,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="trial_id",
@@ -1363,7 +1458,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -1371,6 +1466,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="status",
@@ -1389,6 +1485,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="metrics",
@@ -1407,6 +1504,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="score",
@@ -1425,6 +1523,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -1448,6 +1547,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="name",
@@ -1458,7 +1558,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -1466,6 +1566,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="values",
@@ -1484,6 +1585,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -1504,6 +1606,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="parent",
@@ -1522,6 +1625,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -1539,6 +1643,7 @@
             full_name="keras_tuner.Condition.kind",
             index=0,
             containing_type=None,
+            create_key=_descriptor._internal_create_key,
             fields=[],
         ),
     ],
diff --git a/keras_tuner/protos/keras_tuner_pb2_grpc.py b/keras_tuner/protos/keras_tuner_pb2_grpc.py
index bc2a88c7d..3f2e055db 100644
--- a/keras_tuner/protos/keras_tuner_pb2_grpc.py
+++ b/keras_tuner/protos/keras_tuner_pb2_grpc.py
@@ -13,4 +13,5 @@
 # limitations under the License.
 
 # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
+"""Client and server classes corresponding to protobuf-defined services."""
 import grpc
diff --git a/keras_tuner/protos/service_pb2.py b/keras_tuner/protos/service_pb2.py
index 7369fee86..6591ea750 100644
--- a/keras_tuner/protos/service_pb2.py
+++ b/keras_tuner/protos/service_pb2.py
@@ -16,9 +16,6 @@
 # Generated by the protocol buffer compiler.  DO NOT EDIT!
 # source: keras_tuner/protos/service.proto
 
-import sys
-
-_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
 from google.protobuf import descriptor as _descriptor
 from google.protobuf import message as _message
 from google.protobuf import reflection as _reflection
@@ -39,9 +36,8 @@
     package="keras_tuner",
     syntax="proto3",
     serialized_options=None,
-    serialized_pb=_b(
-        '\n keras_tuner/protos/service.proto\x12\x0bkeras_tuner\x1a$keras_tuner/protos/keras_tuner.proto"\x11\n\x0fGetSpaceRequest"I\n\x10GetSpaceResponse\x12\x35\n\x0fhyperparameters\x18\x01 \x01(\x0b\x32\x1c.keras_tuner.HyperParameters"K\n\x12UpdateSpaceRequest\x12\x35\n\x0fhyperparameters\x18\x01 \x01(\x0b\x32\x1c.keras_tuner.HyperParameters"\x15\n\x13UpdateSpaceResponse"&\n\x12\x43reateTrialRequest\x12\x10\n\x08tuner_id\x18\x01 \x01(\t"8\n\x13\x43reateTrialResponse\x12!\n\x05trial\x18\x01 \x01(\x0b\x32\x12.keras_tuner.Trial"\xa3\x01\n\x12UpdateTrialRequest\x12\x10\n\x08trial_id\x18\x01 \x01(\t\x12=\n\x07metrics\x18\x02 \x03(\x0b\x32,.keras_tuner.UpdateTrialRequest.MetricsEntry\x12\x0c\n\x04step\x18\x03 \x01(\x03\x1a.\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01"?\n\x13UpdateTrialResponse\x12(\n\x06status\x18\x01 \x01(\x0e\x32\x18.keras_tuner.TrialStatus"4\n\x0f\x45ndTrialRequest\x12!\n\x05trial\x18\x01 \x01(\x0b\x32\x12.keras_tuner.Trial"\x12\n\x10\x45ndTrialResponse"*\n\x14GetBestTrialsRequest\x12\x12\n\nnum_trials\x18\x01 \x01(\x03";\n\x15GetBestTrialsResponse\x12"\n\x06trials\x18\x01 \x03(\x0b\x32\x12.keras_tuner.Trial"#\n\x0fGetTrialRequest\x12\x10\n\x08trial_id\x18\x01 \x01(\t"5\n\x10GetTrialResponse\x12!\n\x05trial\x18\x01 \x01(\x0b\x32\x12.keras_tuner.Trial2\xbf\x04\n\x06Oracle\x12I\n\x08GetSpace\x12\x1c.keras_tuner.GetSpaceRequest\x1a\x1d.keras_tuner.GetSpaceResponse"\x00\x12R\n\x0bUpdateSpace\x12\x1f.keras_tuner.UpdateSpaceRequest\x1a .keras_tuner.UpdateSpaceResponse"\x00\x12R\n\x0b\x43reateTrial\x12\x1f.keras_tuner.CreateTrialRequest\x1a .keras_tuner.CreateTrialResponse"\x00\x12R\n\x0bUpdateTrial\x12\x1f.keras_tuner.UpdateTrialRequest\x1a .keras_tuner.UpdateTrialResponse"\x00\x12I\n\x08\x45ndTrial\x12\x1c.keras_tuner.EndTrialRequest\x1a\x1d.keras_tuner.EndTrialResponse"\x00\x12X\n\rGetBestTrials\x12!.keras_tuner.GetBestTrialsRequest\x1a".keras_tuner.GetBestTrialsResponse"\x00\x12I\n\x08GetTrial\x12\x1c.keras_tuner.GetTrialRequest\x1a\x1d.keras_tuner.GetTrialResponse"\x00\x62\x06proto3'
-    ),
+    create_key=_descriptor._internal_create_key,
+    serialized_pb=b'\n keras_tuner/protos/service.proto\x12\x0bkeras_tuner\x1a$keras_tuner/protos/keras_tuner.proto"\x11\n\x0fGetSpaceRequest"I\n\x10GetSpaceResponse\x12\x35\n\x0fhyperparameters\x18\x01 \x01(\x0b\x32\x1c.keras_tuner.HyperParameters"K\n\x12UpdateSpaceRequest\x12\x35\n\x0fhyperparameters\x18\x01 \x01(\x0b\x32\x1c.keras_tuner.HyperParameters"\x15\n\x13UpdateSpaceResponse"&\n\x12\x43reateTrialRequest\x12\x10\n\x08tuner_id\x18\x01 \x01(\t"8\n\x13\x43reateTrialResponse\x12!\n\x05trial\x18\x01 \x01(\x0b\x32\x12.keras_tuner.Trial"\xa3\x01\n\x12UpdateTrialRequest\x12\x10\n\x08trial_id\x18\x01 \x01(\t\x12=\n\x07metrics\x18\x02 \x03(\x0b\x32,.keras_tuner.UpdateTrialRequest.MetricsEntry\x12\x0c\n\x04step\x18\x03 \x01(\x03\x1a.\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01"8\n\x13UpdateTrialResponse\x12!\n\x05trial\x18\x01 \x01(\x0b\x32\x12.keras_tuner.Trial"4\n\x0f\x45ndTrialRequest\x12!\n\x05trial\x18\x01 \x01(\x0b\x32\x12.keras_tuner.Trial"\x12\n\x10\x45ndTrialResponse"*\n\x14GetBestTrialsRequest\x12\x12\n\nnum_trials\x18\x01 \x01(\x03";\n\x15GetBestTrialsResponse\x12"\n\x06trials\x18\x01 \x03(\x0b\x32\x12.keras_tuner.Trial"#\n\x0fGetTrialRequest\x12\x10\n\x08trial_id\x18\x01 \x01(\t"5\n\x10GetTrialResponse\x12!\n\x05trial\x18\x01 \x01(\x0b\x32\x12.keras_tuner.Trial2\xbf\x04\n\x06Oracle\x12I\n\x08GetSpace\x12\x1c.keras_tuner.GetSpaceRequest\x1a\x1d.keras_tuner.GetSpaceResponse"\x00\x12R\n\x0bUpdateSpace\x12\x1f.keras_tuner.UpdateSpaceRequest\x1a .keras_tuner.UpdateSpaceResponse"\x00\x12R\n\x0b\x43reateTrial\x12\x1f.keras_tuner.CreateTrialRequest\x1a .keras_tuner.CreateTrialResponse"\x00\x12R\n\x0bUpdateTrial\x12\x1f.keras_tuner.UpdateTrialRequest\x1a .keras_tuner.UpdateTrialResponse"\x00\x12I\n\x08\x45ndTrial\x12\x1c.keras_tuner.EndTrialRequest\x1a\x1d.keras_tuner.EndTrialResponse"\x00\x12X\n\rGetBestTrials\x12!.keras_tuner.GetBestTrialsRequest\x1a".keras_tuner.GetBestTrialsResponse"\x00\x12I\n\x08GetTrial\x12\x1c.keras_tuner.GetTrialRequest\x1a\x1d.keras_tuner.GetTrialResponse"\x00\x62\x06proto3',
     dependencies=[
         keras__tuner_dot_protos_dot_keras__tuner__pb2.DESCRIPTOR,
     ],
@@ -54,6 +50,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[],
     extensions=[],
     nested_types=[],
@@ -74,6 +71,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="hyperparameters",
@@ -92,6 +90,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -113,6 +112,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="hyperparameters",
@@ -131,6 +131,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -152,6 +153,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[],
     extensions=[],
     nested_types=[],
@@ -172,6 +174,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="tuner_id",
@@ -182,7 +185,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -190,6 +193,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -211,6 +215,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="trial",
@@ -229,6 +234,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -250,6 +256,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="key",
@@ -260,7 +267,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -268,6 +275,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="value",
@@ -286,12 +294,13 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
     nested_types=[],
     enum_types=[],
-    serialized_options=_b("8\001"),
+    serialized_options=b"8\001",
     is_extendable=False,
     syntax="proto3",
     extension_ranges=[],
@@ -306,6 +315,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="trial_id",
@@ -316,7 +326,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -324,6 +334,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="metrics",
@@ -342,6 +353,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.FieldDescriptor(
             name="step",
@@ -360,6 +372,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -383,17 +396,18 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
-            name="status",
-            full_name="keras_tuner.UpdateTrialResponse.status",
+            name="trial",
+            full_name="keras_tuner.UpdateTrialResponse.trial",
             index=0,
             number=1,
-            type=14,
-            cpp_type=8,
+            type=11,
+            cpp_type=10,
             label=1,
             has_default_value=False,
-            default_value=0,
+            default_value=None,
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -401,6 +415,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -412,7 +427,7 @@
     extension_ranges=[],
     oneofs=[],
     serialized_start=545,
-    serialized_end=608,
+    serialized_end=601,
 )
 
 
@@ -422,6 +437,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="trial",
@@ -440,6 +456,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -450,8 +467,8 @@
     syntax="proto3",
     extension_ranges=[],
     oneofs=[],
-    serialized_start=610,
-    serialized_end=662,
+    serialized_start=603,
+    serialized_end=655,
 )
 
 
@@ -461,6 +478,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[],
     extensions=[],
     nested_types=[],
@@ -470,8 +488,8 @@
     syntax="proto3",
     extension_ranges=[],
     oneofs=[],
-    serialized_start=664,
-    serialized_end=682,
+    serialized_start=657,
+    serialized_end=675,
 )
 
 
@@ -481,6 +499,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="num_trials",
@@ -499,6 +518,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -509,8 +529,8 @@
     syntax="proto3",
     extension_ranges=[],
     oneofs=[],
-    serialized_start=684,
-    serialized_end=726,
+    serialized_start=677,
+    serialized_end=719,
 )
 
 
@@ -520,6 +540,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="trials",
@@ -538,6 +559,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -548,8 +570,8 @@
     syntax="proto3",
     extension_ranges=[],
     oneofs=[],
-    serialized_start=728,
-    serialized_end=787,
+    serialized_start=721,
+    serialized_end=780,
 )
 
 
@@ -559,6 +581,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="trial_id",
@@ -569,7 +592,7 @@
             cpp_type=9,
             label=1,
             has_default_value=False,
-            default_value=_b("").decode("utf-8"),
+            default_value=b"".decode("utf-8"),
             message_type=None,
             enum_type=None,
             containing_type=None,
@@ -577,6 +600,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -587,8 +611,8 @@
     syntax="proto3",
     extension_ranges=[],
     oneofs=[],
-    serialized_start=789,
-    serialized_end=824,
+    serialized_start=782,
+    serialized_end=817,
 )
 
 
@@ -598,6 +622,7 @@
     filename=None,
     file=DESCRIPTOR,
     containing_type=None,
+    create_key=_descriptor._internal_create_key,
     fields=[
         _descriptor.FieldDescriptor(
             name="trial",
@@ -616,6 +641,7 @@
             extension_scope=None,
             serialized_options=None,
             file=DESCRIPTOR,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
     extensions=[],
@@ -626,8 +652,8 @@
     syntax="proto3",
     extension_ranges=[],
     oneofs=[],
-    serialized_start=826,
-    serialized_end=879,
+    serialized_start=819,
+    serialized_end=872,
 )
 
 _GETSPACERESPONSE.fields_by_name[
@@ -644,8 +670,8 @@
     "metrics"
 ].message_type = _UPDATETRIALREQUEST_METRICSENTRY
 _UPDATETRIALRESPONSE.fields_by_name[
-    "status"
-].enum_type = keras__tuner_dot_protos_dot_keras__tuner__pb2._TRIALSTATUS
+    "trial"
+].message_type = keras__tuner_dot_protos_dot_keras__tuner__pb2._TRIAL
 _ENDTRIALREQUEST.fields_by_name[
     "trial"
 ].message_type = keras__tuner_dot_protos_dot_keras__tuner__pb2._TRIAL
@@ -846,8 +872,9 @@
     file=DESCRIPTOR,
     index=0,
     serialized_options=None,
-    serialized_start=882,
-    serialized_end=1457,
+    create_key=_descriptor._internal_create_key,
+    serialized_start=875,
+    serialized_end=1450,
     methods=[
         _descriptor.MethodDescriptor(
             name="GetSpace",
@@ -857,6 +884,7 @@
             input_type=_GETSPACEREQUEST,
             output_type=_GETSPACERESPONSE,
             serialized_options=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.MethodDescriptor(
             name="UpdateSpace",
@@ -866,6 +894,7 @@
             input_type=_UPDATESPACEREQUEST,
             output_type=_UPDATESPACERESPONSE,
             serialized_options=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.MethodDescriptor(
             name="CreateTrial",
@@ -875,6 +904,7 @@
             input_type=_CREATETRIALREQUEST,
             output_type=_CREATETRIALRESPONSE,
             serialized_options=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.MethodDescriptor(
             name="UpdateTrial",
@@ -884,6 +914,7 @@
             input_type=_UPDATETRIALREQUEST,
             output_type=_UPDATETRIALRESPONSE,
             serialized_options=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.MethodDescriptor(
             name="EndTrial",
@@ -893,6 +924,7 @@
             input_type=_ENDTRIALREQUEST,
             output_type=_ENDTRIALRESPONSE,
             serialized_options=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.MethodDescriptor(
             name="GetBestTrials",
@@ -902,6 +934,7 @@
             input_type=_GETBESTTRIALSREQUEST,
             output_type=_GETBESTTRIALSRESPONSE,
             serialized_options=None,
+            create_key=_descriptor._internal_create_key,
         ),
         _descriptor.MethodDescriptor(
             name="GetTrial",
@@ -911,6 +944,7 @@
             input_type=_GETTRIALREQUEST,
             output_type=_GETTRIALRESPONSE,
             serialized_options=None,
+            create_key=_descriptor._internal_create_key,
         ),
     ],
 )
diff --git a/keras_tuner/protos/service_pb2_grpc.py b/keras_tuner/protos/service_pb2_grpc.py
index f284373f2..695177dc2 100644
--- a/keras_tuner/protos/service_pb2_grpc.py
+++ b/keras_tuner/protos/service_pb2_grpc.py
@@ -13,6 +13,7 @@
 # limitations under the License.
 
 # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
+"""Client and server classes corresponding to protobuf-defined services."""
 import grpc
 
 from keras_tuner.protos import (
@@ -20,15 +21,14 @@
 )
 
 
-class OracleStub:
-    # missing associated documentation comment in .proto file
-    pass
+class OracleStub(object):
+    """Missing associated documentation comment in .proto file."""
 
     def __init__(self, channel):
         """Constructor.
 
         Args:
-          channel: A grpc.Channel.
+            channel: A grpc.Channel.
         """
         self.GetSpace = channel.unary_unary(
             "/keras_tuner.Oracle/GetSpace",
@@ -67,9 +67,8 @@ def __init__(self, channel):
         )
 
 
-class OracleServicer:
-    # missing associated documentation comment in .proto file
-    pass
+class OracleServicer(object):
+    """Missing associated documentation comment in .proto file."""
 
     def GetSpace(self, request, context):
         """Return the HyperParameter search space."""
@@ -156,3 +155,197 @@ def add_OracleServicer_to_server(servicer, server):
         "keras_tuner.Oracle", rpc_method_handlers
     )
     server.add_generic_rpc_handlers((generic_handler,))
+
+
+# This class is part of an EXPERIMENTAL API.
+class Oracle(object):
+    """Missing associated documentation comment in .proto file."""
+
+    @staticmethod
+    def GetSpace(
+        request,
+        target,
+        options=(),
+        channel_credentials=None,
+        call_credentials=None,
+        compression=None,
+        wait_for_ready=None,
+        timeout=None,
+        metadata=None,
+    ):
+        return grpc.experimental.unary_unary(
+            request,
+            target,
+            "/keras_tuner.Oracle/GetSpace",
+            keras__tuner_dot_protos_dot_service__pb2.GetSpaceRequest.SerializeToString,
+            keras__tuner_dot_protos_dot_service__pb2.GetSpaceResponse.FromString,
+            options,
+            channel_credentials,
+            call_credentials,
+            compression,
+            wait_for_ready,
+            timeout,
+            metadata,
+        )
+
+    @staticmethod
+    def UpdateSpace(
+        request,
+        target,
+        options=(),
+        channel_credentials=None,
+        call_credentials=None,
+        compression=None,
+        wait_for_ready=None,
+        timeout=None,
+        metadata=None,
+    ):
+        return grpc.experimental.unary_unary(
+            request,
+            target,
+            "/keras_tuner.Oracle/UpdateSpace",
+            keras__tuner_dot_protos_dot_service__pb2.UpdateSpaceRequest.SerializeToString,
+            keras__tuner_dot_protos_dot_service__pb2.UpdateSpaceResponse.FromString,
+            options,
+            channel_credentials,
+            call_credentials,
+            compression,
+            wait_for_ready,
+            timeout,
+            metadata,
+        )
+
+    @staticmethod
+    def CreateTrial(
+        request,
+        target,
+        options=(),
+        channel_credentials=None,
+        call_credentials=None,
+        compression=None,
+        wait_for_ready=None,
+        timeout=None,
+        metadata=None,
+    ):
+        return grpc.experimental.unary_unary(
+            request,
+            target,
+            "/keras_tuner.Oracle/CreateTrial",
+            keras__tuner_dot_protos_dot_service__pb2.CreateTrialRequest.SerializeToString,
+            keras__tuner_dot_protos_dot_service__pb2.CreateTrialResponse.FromString,
+            options,
+            channel_credentials,
+            call_credentials,
+            compression,
+            wait_for_ready,
+            timeout,
+            metadata,
+        )
+
+    @staticmethod
+    def UpdateTrial(
+        request,
+        target,
+        options=(),
+        channel_credentials=None,
+        call_credentials=None,
+        compression=None,
+        wait_for_ready=None,
+        timeout=None,
+        metadata=None,
+    ):
+        return grpc.experimental.unary_unary(
+            request,
+            target,
+            "/keras_tuner.Oracle/UpdateTrial",
+            keras__tuner_dot_protos_dot_service__pb2.UpdateTrialRequest.SerializeToString,
+            keras__tuner_dot_protos_dot_service__pb2.UpdateTrialResponse.FromString,
+            options,
+            channel_credentials,
+            call_credentials,
+            compression,
+            wait_for_ready,
+            timeout,
+            metadata,
+        )
+
+    @staticmethod
+    def EndTrial(
+        request,
+        target,
+        options=(),
+        channel_credentials=None,
+        call_credentials=None,
+        compression=None,
+        wait_for_ready=None,
+        timeout=None,
+        metadata=None,
+    ):
+        return grpc.experimental.unary_unary(
+            request,
+            target,
+            "/keras_tuner.Oracle/EndTrial",
+            keras__tuner_dot_protos_dot_service__pb2.EndTrialRequest.SerializeToString,
+            keras__tuner_dot_protos_dot_service__pb2.EndTrialResponse.FromString,
+            options,
+            channel_credentials,
+            call_credentials,
+            compression,
+            wait_for_ready,
+            timeout,
+            metadata,
+        )
+
+    @staticmethod
+    def GetBestTrials(
+        request,
+        target,
+        options=(),
+        channel_credentials=None,
+        call_credentials=None,
+        compression=None,
+        wait_for_ready=None,
+        timeout=None,
+        metadata=None,
+    ):
+        return grpc.experimental.unary_unary(
+            request,
+            target,
+            "/keras_tuner.Oracle/GetBestTrials",
+            keras__tuner_dot_protos_dot_service__pb2.GetBestTrialsRequest.SerializeToString,
+            keras__tuner_dot_protos_dot_service__pb2.GetBestTrialsResponse.FromString,
+            options,
+            channel_credentials,
+            call_credentials,
+            compression,
+            wait_for_ready,
+            timeout,
+            metadata,
+        )
+
+    @staticmethod
+    def GetTrial(
+        request,
+        target,
+        options=(),
+        channel_credentials=None,
+        call_credentials=None,
+        compression=None,
+        wait_for_ready=None,
+        timeout=None,
+        metadata=None,
+    ):
+        return grpc.experimental.unary_unary(
+            request,
+            target,
+            "/keras_tuner.Oracle/GetTrial",
+            keras__tuner_dot_protos_dot_service__pb2.GetTrialRequest.SerializeToString,
+            keras__tuner_dot_protos_dot_service__pb2.GetTrialResponse.FromString,
+            options,
+            channel_credentials,
+            call_credentials,
+            compression,
+            wait_for_ready,
+            timeout,
+            metadata,
+        )
diff --git a/setup.py b/setup.py
index 70d915ed6..502183b41 100644
--- a/setup.py
+++ b/setup.py
@@ -46,6 +46,8 @@
             "namex",
             "scikit-learn",
             "scipy",
+            "protobuf==3.20",
+            "grpcio-tools==1.30",
         ],
         "bayesian": [
             "scikit-learn",
diff --git a/shell/grpc.sh b/shell/grpc.sh
index c6e909409..25a42dfd2 100644
--- a/shell/grpc.sh
+++ b/shell/grpc.sh
@@ -1,4 +1,3 @@
 # Rebuilding rebuilding the gPRC protos
-# pip install grpcio-tools==1.24.3
 python -m grpc_tools.protoc --python_out=. --grpc_python_out=. --proto_path=. keras_tuner/protos/keras_tuner.proto
 python -m grpc_tools.protoc --python_out=. --grpc_python_out=. --proto_path=. keras_tuner/protos/service.proto


Test patch:
diff --git a/keras_tuner/distribute/oracle_client_test.py b/keras_tuner/distribute/oracle_client_test.py
index ebce445aa..75e301e71 100644
--- a/keras_tuner/distribute/oracle_client_test.py
+++ b/keras_tuner/distribute/oracle_client_test.py
@@ -28,6 +28,7 @@
 import keras_tuner
 from keras_tuner.distribute import oracle_client
 from keras_tuner.distribute import utils as dist_utils
+from keras_tuner.engine import hyperparameters as hp_module
 from keras_tuner.test_utils import mock_distribute
 from keras_tuner.tuners import randomsearch
 
@@ -151,7 +152,9 @@ def test_client_no_attribute_error():
             client.unknown_attribute
 
 
-def test_should_not_report_update_trial_return_running():
+@mock.patch("keras_tuner.distribute.oracle_client.OracleClient.get_space")
+def test_should_not_report_update_trial_return_running(get_space):
+    get_space.return_value = hp_module.HyperParameters()
     with mock.patch.object(os, "environ", mock_distribute.MockEnvVars()):
         port = str(portpicker.pick_unused_port())
         os.environ["KERASTUNER_ORACLE_IP"] = "127.0.0.1"
@@ -165,4 +168,4 @@ def test_should_not_report_update_trial_return_running():
         )
         client = oracle_client.OracleClient(oracle)
         client.should_report = False
-        assert client.update_trial("a", {"score": 100}) == "RUNNING"
+        assert client.update_trial("a", {"score": 100}).status == "RUNNING"
diff --git a/keras_tuner/engine/trial_test.py b/keras_tuner/engine/trial_test.py
index a74c684ba..5238f5fb9 100644
--- a/keras_tuner/engine/trial_test.py
+++ b/keras_tuner/engine/trial_test.py
@@ -35,11 +35,11 @@ def test_trial_proto():
     assert not proto.HasField("score")
 
     new_trial = trial_module.Trial.from_proto(proto)
-    assert new_trial.status == "COMPLETED"
+    assert new_trial.status == trial.status
     assert new_trial.hyperparameters.get("a") == 3
-    assert new_trial.trial_id == "trial1"
-    assert new_trial.score is None
-    assert new_trial.best_step == 0
+    assert new_trial.trial_id == trial.trial_id
+    assert new_trial.score == trial.score
+    assert new_trial.best_step == trial.best_step
 
     trial.score = -10
     trial.best_step = 3