Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master #53

Merged
merged 2 commits into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,16 @@ The tool dispatches and runs trial jobs generated by tuning algorithms to search

## **Install & Verify**

**Install through source code**
* We only support Linux (Ubuntu 16.04 or higher) in our current stage.
* Run the following commands in an environment that has `python >= 3.5`, `git` and `wget`.
```bash
git clone -b v0.3 https://github.com/Microsoft/nni.git
cd nni
source install.sh
```
**pip install**
* We only support Linux in current stage, Ubuntu 16.04 or higher are tested and supported. Simply run the following `pip install` in an environment that has `python >= 3.5`, `git` and `wget`.

**Verify install**
* The following example is an experiment built on TensorFlow. Make sure you have `TensorFlow installed` before running it.
* Download the examples via clone the source code.
```bash
cd ~
git clone -b v0.3 https://github.com/Microsoft/nni.git
```
* Run the mnist example.
python3 -m pip install -v --user git+https://github.com/Microsoft/nni.git@v0.2
source ~/.bashrc
```

**verify install**
* The following example is an experiment built on TensorFlow, make sure you have `TensorFlow installed` before running it.
```bash
nnictl create --config ~/nni/examples/trials/mnist/config.yml
```
Expand All @@ -51,7 +44,7 @@ The tool dispatches and runs trial jobs generated by tuning algorithms to search
Info: Checking web ui...
Info: Starting web ui...
Info: Starting web ui success!
+ Info: Web UI url: http://127.0.0.1:8080 http://10.172.141.6:8080
+ Info: Web UI url: http://yourlocalhost:8080 http://youripaddress:8080
+ Info: Start experiment success! The experiment id is LrNK4hae, and the restful server post is 51188.
```

Expand Down
3 changes: 3 additions & 0 deletions deployment/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions docs/InstallNNI_Ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@

* __Install NNI through pip__

python3 -m pip install --user nni-pkg
pip3 install -v --user git+https://github.com/Microsoft/nni.git@v0.2
source ~/.bashrc

* __Install NNI through source code__

git clone -b v0.3 https://github.com/Microsoft/nni.git
git clone -b v0.2 https://github.com/Microsoft/nni.git
cd nni
chmod +x install.sh
source install.sh


## Further reading
* [Overview](Overview.md)
* [Use command line tool nnictl](NNICTLDOC.md)
Expand Down
4 changes: 4 additions & 0 deletions examples/trials/sklearn/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
8 changes: 6 additions & 2 deletions tools/nnicmd/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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'''
Expand Down
16 changes: 12 additions & 4 deletions tools/nnicmd/nnictl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ def check_experiment_id(args):
if not args.id:
running_experiment_list = []
for key in experiment_dict.keys():
if experiment_dict[key]['status'] == 'running':
running_experiment_list.append(key)
if isinstance(experiment_dict[key], dict):
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:
print_error('There are multiple experiments running, please set the experiment id...')
experiment_information = ""
Expand Down Expand Up @@ -80,8 +84,12 @@ def parse_ids(args):
result_list = []
running_experiment_list = []
for key in experiment_dict.keys():
if experiment_dict[key]['status'] == 'running':
running_experiment_list.append(key)
if isinstance(experiment_dict[key], dict):
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 len(running_experiment_list) > 1:
print_error('There are multiple experiments running, please set the experiment id...')
Expand Down