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
bbb9137c
"git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "fb9326740078b8e159cad8abab40cddd3b7f1308"
Unverified
Commit
bbb9137c
authored
Aug 14, 2020
by
SparkSnail
Committed by
GitHub
Aug 14, 2020
Browse files
Fix nnictl experiment delete (#2791)
parent
07cb73b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
tools/nni_cmd/nnictl_utils.py
tools/nni_cmd/nnictl_utils.py
+9
-6
No files found.
tools/nni_cmd/nnictl_utils.py
View file @
bbb9137c
...
@@ -11,7 +11,6 @@ import shutil
...
@@ -11,7 +11,6 @@ import shutil
import
subprocess
import
subprocess
from
functools
import
cmp_to_key
from
functools
import
cmp_to_key
from
datetime
import
datetime
,
timezone
from
datetime
import
datetime
,
timezone
from
pathlib
import
Path
from
subprocess
import
Popen
from
subprocess
import
Popen
from
pyhdfs
import
HdfsClient
from
pyhdfs
import
HdfsClient
from
nni.package_utils
import
get_nni_installation_path
from
nni.package_utils
import
get_nni_installation_path
...
@@ -517,11 +516,15 @@ def experiment_clean(args):
...
@@ -517,11 +516,15 @@ def experiment_clean(args):
print_warning
(
'platform {0} clean up not supported yet.'
.
format
(
platform
))
print_warning
(
'platform {0} clean up not supported yet.'
.
format
(
platform
))
exit
(
0
)
exit
(
0
)
#clean local data
#clean local data
home
=
str
(
Path
.
home
())
local_base_dir
=
nni_config
.
get_config
(
'experimentConfig'
).
get
(
'logDir'
)
local_dir
=
nni_config
.
get_config
(
'experimentConfig'
).
get
(
'logDir'
)
if
not
local_base_dir
:
if
not
local_dir
:
local_base_dir
=
NNI_HOME_DIR
local_dir
=
os
.
path
.
join
(
home
,
'nni-experiments'
,
experiment_id
)
local_experiment_dir
=
os
.
path
.
join
(
local_base_dir
,
experiment_id
)
local_clean
(
local_dir
)
experiment_folder_name_list
=
[
'checkpoint'
,
'db'
,
'log'
,
'trials'
]
for
folder_name
in
experiment_folder_name_list
:
local_clean
(
os
.
path
.
join
(
local_experiment_dir
,
folder_name
))
if
not
os
.
listdir
(
local_experiment_dir
):
local_clean
(
local_experiment_dir
)
experiment_config
=
Experiments
()
experiment_config
=
Experiments
()
print_normal
(
'removing metadata of experiment {0}'
.
format
(
experiment_id
))
print_normal
(
'removing metadata of experiment {0}'
.
format
(
experiment_id
))
experiment_config
.
remove_experiment
(
experiment_id
)
experiment_config
.
remove_experiment
(
experiment_id
)
...
...
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