Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
94e98240
Unverified
Commit
94e98240
authored
Jan 05, 2022
by
QuanluZhang
Committed by
GitHub
Jan 05, 2022
Browse files
[bug fix] fix the bug in update search space (#4438)
parent
3f6a8274
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
nni/experiment/experiment.py
nni/experiment/experiment.py
+0
-2
nni/tools/nnictl/updater.py
nni/tools/nnictl/updater.py
+9
-2
ts/nni_manager/core/nnimanager.ts
ts/nni_manager/core/nnimanager.ts
+3
-3
No files found.
nni/experiment/experiment.py
View file @
94e98240
...
@@ -11,7 +11,6 @@ import colorama
...
@@ -11,7 +11,6 @@ import colorama
import
psutil
import
psutil
import
nni.runtime.log
import
nni.runtime.log
from
nni.common
import
dump
from
.config
import
ExperimentConfig
from
.config
import
ExperimentConfig
from
.data
import
TrialJob
,
TrialMetricData
,
TrialResult
from
.data
import
TrialJob
,
TrialMetricData
,
TrialResult
...
@@ -463,7 +462,6 @@ class Experiment:
...
@@ -463,7 +462,6 @@ class Experiment:
value: dict
value: dict
New search_space.
New search_space.
"""
"""
value
=
dump
(
value
)
self
.
_update_experiment_profile
(
'searchSpace'
,
value
)
self
.
_update_experiment_profile
(
'searchSpace'
,
value
)
def
update_max_trial_number
(
self
,
value
:
int
):
def
update_max_trial_number
(
self
,
value
:
int
):
...
...
nni/tools/nnictl/updater.py
View file @
94e98240
...
@@ -41,7 +41,7 @@ def validate_dispatcher(args):
...
@@ -41,7 +41,7 @@ def validate_dispatcher(args):
def
load_search_space
(
path
):
def
load_search_space
(
path
):
'''load search space content'''
'''load search space content'''
content
=
json
.
dumps
(
get_json_content
(
path
)
)
content
=
get_json_content
(
path
)
if
not
content
:
if
not
content
:
raise
ValueError
(
'searchSpace file should not be empty'
)
raise
ValueError
(
'searchSpace file should not be empty'
)
return
content
return
content
...
@@ -112,11 +112,18 @@ def update_trialnum(args):
...
@@ -112,11 +112,18 @@ def update_trialnum(args):
else
:
else
:
print_error
(
'Update %s failed!'
%
'trialnum'
)
print_error
(
'Update %s failed!'
%
'trialnum'
)
def
load_imported_data
(
path
):
'''load the trial data that will be imported'''
content
=
json
.
dumps
(
get_json_content
(
path
))
if
not
content
:
raise
ValueError
(
'Imported data should not be empty'
)
return
content
def
import_data
(
args
):
def
import_data
(
args
):
'''import additional data to the experiment'''
'''import additional data to the experiment'''
validate_file
(
args
.
filename
)
validate_file
(
args
.
filename
)
validate_dispatcher
(
args
)
validate_dispatcher
(
args
)
content
=
load_
search_space
(
args
.
filename
)
content
=
load_
imported_data
(
args
.
filename
)
experiments_dict
=
Experiments
().
get_all_experiments
()
experiments_dict
=
Experiments
().
get_all_experiments
()
experiment_id
=
get_config_filename
(
args
)
experiment_id
=
get_config_filename
(
args
)
...
...
ts/nni_manager/core/nnimanager.ts
View file @
94e98240
...
@@ -509,13 +509,13 @@ class NNIManager implements Manager {
...
@@ -509,13 +509,13 @@ class NNIManager implements Manager {
return
;
return
;
}
}
private
updateSearchSpace
(
searchSpace
:
string
):
void
{
private
updateSearchSpace
(
searchSpace
:
object
):
void
{
if
(
this
.
dispatcher
===
undefined
)
{
if
(
this
.
dispatcher
===
undefined
)
{
throw
new
Error
(
'
Error: tuner has not been setup
'
);
throw
new
Error
(
'
Error: tuner has not been setup
'
);
}
}
this
.
log
.
info
(
`Updated search space
${
searchSpace
}
`
);
this
.
log
.
info
(
`Updated search space
${
searchSpace
}
`
);
this
.
dispatcher
.
sendCommand
(
UPDATE_SEARCH_SPACE
,
searchSpace
);
this
.
dispatcher
.
sendCommand
(
UPDATE_SEARCH_SPACE
,
JSON
.
stringify
(
searchSpace
)
)
;
this
.
experimentProfile
.
params
.
searchSpace
=
JSON
.
parse
(
searchSpace
)
;
this
.
experimentProfile
.
params
.
searchSpace
=
searchSpace
;
return
;
return
;
}
}
...
...
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