diff --git a/deployment/docker/Dockerfile b/deployment/docker/Dockerfile index f15c1c7148..73a6dc45df 100644 --- a/deployment/docker/Dockerfile +++ b/deployment/docker/Dockerfile @@ -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 +#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: WORKDIR /root \ No newline at end of file diff --git a/examples/trials/sklearn/requirements.txt b/examples/trials/sklearn/requirements.txt new file mode 100644 index 0000000000..6e2a708386 --- /dev/null +++ b/examples/trials/sklearn/requirements.txt @@ -0,0 +1,4 @@ +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 diff --git a/tools/nnicmd/launcher.py b/tools/nnicmd/launcher.py index 16235cb813..0761d10983 100644 --- a/tools/nnicmd/launcher.py +++ b/tools/nnicmd/launcher.py @@ -216,7 +216,7 @@ def set_experiment(experiment_config, mode, port, config_file_name): if response: with open(stderr_full_path, 'a+') as fout: 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 def launch_experiment(args, experiment_config, mode, config_file_name, experiment_id=None): @@ -349,7 +349,11 @@ def resume_experiment(args): nni_config = Config(experiment_dict[experiment_id]['fileName']) experiment_config = nni_config.get_config('experimentConfig') 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): '''start a new experiment''' diff --git a/tools/nnicmd/nnictl_utils.py b/tools/nnicmd/nnictl_utils.py index 1585890508..e549dd99ee 100644 --- a/tools/nnicmd/nnictl_utils.py +++ b/tools/nnicmd/nnictl_utils.py @@ -42,11 +42,12 @@ def check_experiment_id(args): if not args.id: running_experiment_list = [] for key in experiment_dict.keys(): - try: - if experiment_dict[key]['status'] == 'running': + if isinstance(experiment_dict[key], dict): + if experiment_dict[key].get('status') == 'running': running_experiment_list.append(key) - except: - pass + 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: print_error('There are multiple experiments running, please set the experiment id...') experiment_information = "" @@ -83,11 +84,12 @@ def parse_ids(args): result_list = [] running_experiment_list = [] for key in experiment_dict.keys(): - try: - if experiment_dict[key]['status'] == 'running': + if isinstance(experiment_dict[key], dict): + if experiment_dict[key].get('status') == 'running': running_experiment_list.append(key) - except: - pass + 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 len(running_experiment_list) > 1: print_error('There are multiple experiments running, please set the experiment id...')