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
593d2d20
"docs/advanced/vscode:/vscode.git/clone" did not exist on "67b52d808e973bbdaed2d371df7ee74b173eb7ae"
Unverified
Commit
593d2d20
authored
Aug 19, 2020
by
Junwei Sun
Committed by
GitHub
Aug 19, 2020
Browse files
fix nnictl experiment delete (delete log folder in ~/.local/nnictl) (#2799)
parent
bbb9137c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
tools/nni_cmd/config_utils.py
tools/nni_cmd/config_utils.py
+9
-1
No files found.
tools/nni_cmd/config_utils.py
View file @
593d2d20
...
...
@@ -3,7 +3,9 @@
import
os
import
json
import
shutil
from
.constants
import
NNICTL_HOME_DIR
from
.command_utils
import
print_error
class
Config
:
'''a util class to load and save config'''
...
...
@@ -77,7 +79,13 @@ class Experiments:
def
remove_experiment
(
self
,
expId
):
'''remove an experiment by id'''
if
expId
in
self
.
experiments
:
self
.
experiments
.
pop
(
expId
)
fileName
=
self
.
experiments
.
pop
(
expId
).
get
(
'fileName'
)
if
fileName
:
logPath
=
os
.
path
.
join
(
NNICTL_HOME_DIR
,
fileName
)
try
:
shutil
.
rmtree
(
logPath
)
except
FileNotFoundError
:
print_error
(
'{0} does not exist.'
.
format
(
logPath
))
self
.
write_file
()
def
get_all_experiments
(
self
):
...
...
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