Unverified Commit fe533e3b authored by Yuge Zhang's avatar Yuge Zhang Committed by GitHub
Browse files

Fix metrics decode error on non-local platform (#2152)

parent bf71419f
...@@ -63,9 +63,8 @@ def get_next_parameter(): ...@@ -63,9 +63,8 @@ def get_next_parameter():
def send_metric(string): def send_metric(string):
if _nni_platform != 'local': if _nni_platform != 'local':
data = (string).encode('utf8') assert len(string) < 1000000, 'Metric too long'
assert len(data) < 1000000, 'Metric too long' print("NNISDK_MEb'%s'" % (string), flush=True)
print('NNISDK_ME%s' % (data), flush=True)
else: else:
data = (string + '\n').encode('utf8') data = (string + '\n').encode('utf8')
assert len(data) < 1000000, 'Metric too long' assert len(data) < 1000000, 'Metric too long'
......
...@@ -125,8 +125,9 @@ def report_final_result(metric): ...@@ -125,8 +125,9 @@ def report_final_result(metric):
Parameters Parameters
---------- ----------
metric: metric: serializable object
serializable object. Usually (for built-in tuners to work), it should be a number, or
a dict with key "default" (a number), and any other extra keys.
""" """
assert _params or trial_env_vars.NNI_PLATFORM is None, \ assert _params or trial_env_vars.NNI_PLATFORM is None, \
'nni.get_next_parameter() needs to be called before report_final_result' 'nni.get_next_parameter() needs to be called before report_final_result'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment