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
45daf3e8
Commit
45daf3e8
authored
May 28, 2019
by
demianzhang
Committed by
xuehui
May 28, 2019
Browse files
Check PowerShell execution policy (#1114)
parent
f5d7e664
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
tools/nni_cmd/launcher.py
tools/nni_cmd/launcher.py
+7
-0
No files found.
tools/nni_cmd/launcher.py
View file @
45daf3e8
...
@@ -343,6 +343,13 @@ def set_experiment(experiment_config, mode, port, config_file_name):
...
@@ -343,6 +343,13 @@ def set_experiment(experiment_config, mode, port, config_file_name):
def
launch_experiment
(
args
,
experiment_config
,
mode
,
config_file_name
,
experiment_id
=
None
):
def
launch_experiment
(
args
,
experiment_config
,
mode
,
config_file_name
,
experiment_id
=
None
):
'''follow steps to start rest server and start experiment'''
'''follow steps to start rest server and start experiment'''
nni_config
=
Config
(
config_file_name
)
nni_config
=
Config
(
config_file_name
)
# check execution policy in powershell
if
sys
.
platform
==
'win32'
:
execution_policy
=
check_output
([
'powershell.exe'
,
'Get-ExecutionPolicy'
]).
decode
(
'ascii'
).
strip
()
if
execution_policy
==
'Restricted'
:
print_error
(
'PowerShell execution policy error, please run PowerShell as administrator with this command first:
\r\n
'
\
+
'
\'
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
\'
'
)
exit
(
1
)
# check packages for tuner
# check packages for tuner
package_name
,
module_name
=
None
,
None
package_name
,
module_name
=
None
,
None
if
experiment_config
.
get
(
'tuner'
)
and
experiment_config
[
'tuner'
].
get
(
'builtinTunerName'
):
if
experiment_config
.
get
(
'tuner'
)
and
experiment_config
[
'tuner'
].
get
(
'builtinTunerName'
):
...
...
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