Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
fe533e3b
Unverified
Commit
fe533e3b
authored
Mar 20, 2020
by
Yuge Zhang
Committed by
GitHub
Mar 20, 2020
Browse files
Fix metrics decode error on non-local platform (#2152)
parent
bf71419f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/sdk/pynni/nni/platform/local.py
src/sdk/pynni/nni/platform/local.py
+2
-3
src/sdk/pynni/nni/trial.py
src/sdk/pynni/nni/trial.py
+3
-2
No files found.
src/sdk/pynni/nni/platform/local.py
View file @
fe533e3b
...
...
@@ -63,9 +63,8 @@ def get_next_parameter():
def
send_metric
(
string
):
if
_nni_platform
!=
'local'
:
data
=
(
string
).
encode
(
'utf8'
)
assert
len
(
data
)
<
1000000
,
'Metric too long'
print
(
'NNISDK_ME%s'
%
(
data
),
flush
=
True
)
assert
len
(
string
)
<
1000000
,
'Metric too long'
print
(
"NNISDK_MEb'%s'"
%
(
string
),
flush
=
True
)
else
:
data
=
(
string
+
'
\n
'
).
encode
(
'utf8'
)
assert
len
(
data
)
<
1000000
,
'Metric too long'
...
...
src/sdk/pynni/nni/trial.py
View file @
fe533e3b
...
...
@@ -125,8 +125,9 @@ def report_final_result(metric):
Parameters
----------
metric:
serializable object.
metric: 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
,
\
'nni.get_next_parameter() needs to be called before report_final_result'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment