"docs/git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "3cffe34030b1696df10b6f7a5330ffabab7cc4ae"
Unverified Commit 5bb544ff authored by SparkSnail's avatar SparkSnail Committed by GitHub
Browse files

Fix nnictl in master (#300)

1.Fix old version of config file
2.fix sklearn requirements
3.Fix resume log logic
parent f710f726
...@@ -65,6 +65,9 @@ RUN python3 -m pip --no-cache-dir install tensorflow-gpu==1.10.0 ...@@ -65,6 +65,9 @@ RUN python3 -m pip --no-cache-dir install tensorflow-gpu==1.10.0
# #
RUN python3 -m pip --no-cache-dir install Keras==2.1.6 RUN python3 -m pip --no-cache-dir install Keras==2.1.6
#sklearn
RUN python3 -m pip --no-cache-dir install scikit-learn
ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/root/.local/bin:/usr/bin: ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/root/.local/bin:/usr/bin:
WORKDIR /root WORKDIR /root
\ No newline at end of file
pip3 install numpy
sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
sudo pip3 install scipy
sudo pip3 install sklearn
\ No newline at end of file
...@@ -216,7 +216,7 @@ def set_experiment(experiment_config, mode, port, config_file_name): ...@@ -216,7 +216,7 @@ def set_experiment(experiment_config, mode, port, config_file_name):
if response: if response:
with open(stderr_full_path, 'a+') as fout: with open(stderr_full_path, 'a+') as fout:
fout.write(json.dumps(json.loads(response.text), indent=4, sort_keys=True, separators=(',', ':'))) fout.write(json.dumps(json.loads(response.text), indent=4, sort_keys=True, separators=(',', ':')))
print_error('Setting experiment error, error message is {}'.format(response.text)) print_error('Setting experiment error, error message is {}'.format(response.text))
return None return None
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):
...@@ -349,7 +349,11 @@ def resume_experiment(args): ...@@ -349,7 +349,11 @@ def resume_experiment(args):
nni_config = Config(experiment_dict[experiment_id]['fileName']) nni_config = Config(experiment_dict[experiment_id]['fileName'])
experiment_config = nni_config.get_config('experimentConfig') experiment_config = nni_config.get_config('experimentConfig')
experiment_id = nni_config.get_config('experimentId') experiment_id = nni_config.get_config('experimentId')
launch_experiment(args, experiment_config, 'resume', experiment_dict[experiment_id]['fileName'], experiment_id) new_config_file_name = ''.join(random.sample(string.ascii_letters + string.digits, 8))
new_nni_config = Config(new_config_file_name)
new_nni_config.set_config('experimentConfig', experiment_config)
launch_experiment(args, experiment_config, 'resume', new_config_file_name, experiment_id)
new_nni_config.set_config('restServerPort', args.port)
def create_experiment(args): def create_experiment(args):
'''start a new experiment''' '''start a new experiment'''
......
...@@ -42,8 +42,12 @@ def check_experiment_id(args): ...@@ -42,8 +42,12 @@ def check_experiment_id(args):
if not args.id: if not args.id:
running_experiment_list = [] running_experiment_list = []
for key in experiment_dict.keys(): for key in experiment_dict.keys():
if experiment_dict[key]['status'] == 'running': if isinstance(experiment_dict[key], dict):
running_experiment_list.append(key) if experiment_dict[key].get('status') == 'running':
running_experiment_list.append(key)
elif isinstance(experiment_dict[key], list):
# if the config file is old version, remove the configuration from file
experiment_config.remove_experiment(key)
if len(running_experiment_list) > 1: if len(running_experiment_list) > 1:
print_error('There are multiple experiments running, please set the experiment id...') print_error('There are multiple experiments running, please set the experiment id...')
experiment_information = "" experiment_information = ""
...@@ -80,8 +84,12 @@ def parse_ids(args): ...@@ -80,8 +84,12 @@ def parse_ids(args):
result_list = [] result_list = []
running_experiment_list = [] running_experiment_list = []
for key in experiment_dict.keys(): for key in experiment_dict.keys():
if experiment_dict[key]['status'] == 'running': if isinstance(experiment_dict[key], dict):
running_experiment_list.append(key) if experiment_dict[key].get('status') == 'running':
running_experiment_list.append(key)
elif isinstance(experiment_dict[key], list):
# if the config file is old version, remove the configuration from file
experiment_config.remove_experiment(key)
if not args.id: if not args.id:
if len(running_experiment_list) > 1: if len(running_experiment_list) > 1:
print_error('There are multiple experiments running, please set the experiment id...') print_error('There are multiple experiments running, please set the experiment id...')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment