Installation.md 7.16 KB
Newer Older
Chi Song's avatar
Chi Song committed
1
2
# 安装 NNI

QuanluZhang's avatar
QuanluZhang committed
3
当前支持在 Linux,macOS 和 Windows 下安装。
Chi Song's avatar
Chi Song committed
4

QuanluZhang's avatar
QuanluZhang committed
5
## 在 Linux 或 macOS 上安装
Chi Song's avatar
Chi Song committed
6

QuanluZhang's avatar
QuanluZhang committed
7
* 通过 pip 命令安装 NNI
Chi Song's avatar
Chi Song committed
8
    
QuanluZhang's avatar
QuanluZhang committed
9
    先决条件:`python 64-bit >= 3.5`
Chi Song's avatar
Chi Song committed
10
11
12
13
14
    
    ```bash
    python3 -m pip install --upgrade nni
    ```

QuanluZhang's avatar
QuanluZhang committed
15
* 通过源代码安装 NNI
Chi Song's avatar
Chi Song committed
16
    
QuanluZhang's avatar
QuanluZhang committed
17
18
19
    如果对某个或最新版本的代码感兴趣,可通过源代码安装 NNI。
    
    先决条件:`python 64-bit >=3.5`, `git`, `wget`
Chi Song's avatar
Chi Song committed
20
21
    
    ```bash
Chi Song's avatar
Chi Song committed
22
    git clone -b v0.8 https://github.com/Microsoft/nni.git
Chi Song's avatar
Chi Song committed
23
24
25
26
    cd nni
    ./install.sh
    ```

QuanluZhang's avatar
QuanluZhang committed
27
* 在 Docker 映像中使用 NNI
Chi Song's avatar
Chi Song committed
28
29
30
    
    也可将 NNI 安装到 docker 映像中。 参考[这里](../deployment/docker/README.md)来生成 NNI 的 Docker 映像。 也可通过此命令从 Docker Hub 中直接拉取 NNI 的映像 `docker pull msranni/nni:latest`

QuanluZhang's avatar
QuanluZhang committed
31
## 在 Windows 上安装
Chi Song's avatar
Chi Song committed
32

QuanluZhang's avatar
QuanluZhang committed
33
强烈建议使用 Anaconda 或 Miniconda 来管理多个 Python 环境。
Chi Song's avatar
Chi Song committed
34

QuanluZhang's avatar
QuanluZhang committed
35
* 通过 pip 命令安装 NNI
Chi Song's avatar
Chi Song committed
36
    
QuanluZhang's avatar
QuanluZhang committed
37
    先决条件:`python 64-bit >= 3.5`
Chi Song's avatar
Chi Song committed
38
39
40
41
42
    
    ```bash
    python -m pip install --upgrade nni
    ```

QuanluZhang's avatar
QuanluZhang committed
43
44
45
* 通过源代码安装 NNI
    
    如果对某个或最新版本的代码感兴趣,可通过源代码安装 NNI。
Chi Song's avatar
Chi Song committed
46
    
QuanluZhang's avatar
QuanluZhang committed
47
    先决条件:`python 64-bit >=3.5`, `git`, `PowerShell`
Chi Song's avatar
Chi Song committed
48
    
Chi Song's avatar
Chi Song committed
49
    ```bash
Chi Song's avatar
Chi Song committed
50
    git clone -b v0.8 https://github.com/Microsoft/nni.git
Chi Song's avatar
Chi Song committed
51
    cd nni
Chi Song's avatar
Chi Song committed
52
    powershell -ExecutionPolicy Bypass -file install.ps1
Chi Song's avatar
Chi Song committed
53
54
    ```

QuanluZhang's avatar
QuanluZhang committed
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
## 验证安装

以下示例基于 TensorFlow 1.x 。确保运行环境中使用的的是 ** TensorFlow 1.x**

* 通过克隆源代码下载示例。
    
    ```bash
    git clone -b v1.3 https://github.com/Microsoft/nni.git
    ```

* 运行 MNIST 示例。
    
    Linux 或 macOS
    
    ```bash
    nnictl create --config nni/examples/trials/mnist-tfv1/config.yml
    ```
    
    Windows
    
    ```bash
    nnictl create --config nni\examples\trials\mnist-tfv1\config_windows.yml
    ```

* 在命令行中等待输出 `INFO: Successfully started experiment!`。 此消息表明 Experiment 已成功启动。 通过命令行输出的 `Web UI url` 来访问 Experiment 的界面。

```text
INFO: Starting restful server...
INFO: Successfully started Restful server!
INFO: Setting local config...
INFO: Successfully set local config!
INFO: Starting experiment...
INFO: Successfully started experiment!
-----------------------------------------------------------------------
The experiment id is egchD4qy
The Web UI urls are: http://223.255.255.1:8080   http://127.0.0.1:8080
-----------------------------------------------------------------------

You can use these commands to get more information about the experiment
-----------------------------------------------------------------------
         commands                       description

1. nnictl experiment show        show the information of experiments
2. nnictl trial ls               list all of trial jobs
3. nnictl top                    monitor the status of running experiments
4. nnictl log stderr             show stderr log content
5. nnictl log stdout             show stdout log content
6. nnictl stop                   stop an experiment
7. nnictl trial kill             kill a trial job by id
8. nnictl --help                 get help information about nnictl
-----------------------------------------------------------------------
```

* 在浏览器中打开 `Web UI url`,可看到下图的 Experiment 详细信息,以及所有的 Trial 任务。 查看[这里](../Tutorial/WebUI.md)的更多页面。

![概述](../../img/webui_overview_page.png)

![详细说明](../../img/webui_trialdetail_page.png)

## 系统需求

由于程序变更,NNI 的最低配置会有所更改。

### Linux

|          | 推荐配置                                      | 最低配置                                  |
| -------- | ----------------------------------------- | ------------------------------------- |
| **操作系统** | Ubuntu 16.04 或以上版本                        |                                       |
| **CPU**  | Intel® Core™ i5 或 AMD Phenom™ II X3 或更高配置 | Intel® Core™ i3 或 AMD Phenom™ X3 8650 |
| **GPU**  | NVIDIA® GeForce® GTX 660 或更高配置            | NVIDIA® GeForce® GTX 460              |
| **内存**   | 6 GB                                      | 4 GB                                  |
| **存储**   | 30 GB 可用的磁盘空间                             |                                       |
| **网络**   | 宽带连接                                      |                                       |
| **分辨率**  | 1024 x 768 以上                             |                                       |

### macOS

|          | 推荐配置                     | 最低配置                                               |
| -------- | ------------------------ | -------------------------------------------------- |
| **操作系统** | macOS 10.14.1 或更高版本      |                                                    |
| **CPU**  | Intel® Core™ i7-4770 或更高 | Intel® Core™ i5-760 或更高                            |
| **GPU**  | AMD Radeon™ R9 M395X 或更高 | NVIDIA® GeForce® GT 750M 或 AMD Radeon™ R9 M290 或更高 |
| **内存**   | 8 GB                     | 4 GB                                               |
| **存储**   | 70GB 可用空间 SSD 硬盘         | 70GB 可用空间及 7200 RPM 硬盘                             |
| **网络**   | 宽带连接                     |                                                    |
| **分辨率**  | 1024 x 768 以上            |                                                    |

### Windows

|          | 推荐配置                                      | 最低配置                                  |
| -------- | ----------------------------------------- | ------------------------------------- |
| **操作系统** | Windows 10 1809 或更高版本                     |                                       |
| **CPU**  | Intel® Core™ i5 或 AMD Phenom™ II X3 或更高配置 | Intel® Core™ i3 或 AMD Phenom™ X3 8650 |
| **GPU**  | NVIDIA® GeForce® GTX 660 或更高配置            | NVIDIA® GeForce® GTX 460              |
| **内存**   | 6 GB                                      | 4 GB                                  |
| **存储**   | 30 GB 可用的磁盘空间                             |                                       |
| **网络**   | 宽带连接                                      |                                       |
| **分辨率**  | 1024 x 768 以上                             |                                       |
Chi Song's avatar
Chi Song committed
153

Chi Song's avatar
Chi Song committed
154
155
## 更多

Chi Song's avatar
Chi Song committed
156
* [概述](../Overview.md)
Chi Song's avatar
Chi Song committed
157
* [使用命令行工具 nnictl](Nnictl.md)
Chi Song's avatar
Chi Song committed
158
159
160
* [使用 NNIBoard](WebUI.md)
* [定制搜索空间](SearchSpaceSpec.md)
* [配置 Experiment](ExperimentConfig.md)
Chi Song's avatar
Chi Song committed
161
162
163
164
165
* [如何在本机运行 Experiment (支持多 GPU 卡)?](../TrainingService/LocalMode.md)
* [如何在多机上运行 Experiment?](../TrainingService/RemoteMachineMode.md)
* [如何在 OpenPAI 上运行 Experiment?](../TrainingService/PaiMode.md)
* [如何通过 Kubeflow 在 Kubernetes 上运行 Experiment?](../TrainingService/KubeflowMode.md)
* [如何通过 FrameworkController 在 Kubernetes 上运行 Experiment?](../TrainingService/FrameworkControllerMode.md)