README.md 1.42 KB
Newer Older
panning's avatar
panning committed
1
2
3
4
5
6
7
8


## **安装**

### **安装方式**

#### **使用pip方式安装**

panning's avatar
panning committed
9
vision whl包下载位置:[vision | 光合开发者社区](https://cancon.hpccube.com:65024/4/main/vision),进入对应DTK目录(dtk23.10)根据Python版本选择安装包。
panning's avatar
panning committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

```bash
pip3 install torchvision*
```

#### **使用源码安装**

##### 编译环境准备

- 安装相关依赖

  ```
  #可通过conda或源码编译安装libpng/libjpeg
  conda install libpng
  conda install jpeg
  #注:libpng和libjpeg必须在编译时可用,确保它在标准库位置可用,否则,分别在环境变量TORCHVISION_INCLUDE和TORCHVISION_LIBRARY中添加头文件路径和库路径。
  
  pip3 install pybind11 
  pip3 install 'numpy<=1.23.5' 
  pip3 install 'urllib3==1.26.14' 
  pip3 install requests 
  pip3 install wheel 
  ```

panning's avatar
panning committed
34
-[首页 | 光合开发者社区](https://cancon.hpccube.com:65024/1/main)下载 dtk23.10 解压至 /opt/ 路径下,并建立软链接
panning's avatar
panning committed
35
36

  ```
panning's avatar
panning committed
37
  cd /opt && ln -s dtk-23.10 dtk
panning's avatar
panning committed
38
39
40
  source /opt/dtk/env.sh
  ```

panning's avatar
panning committed
41
-[pytorch | 光合开发者社区](https://cancon.hpccube.com:65024/4/main/pytorch)下载对应的 pytorch安装包(需对应dtk23.10版本与 Python版本)
panning's avatar
panning committed
42
43
44
45
46
47
48
49

  ```
  pip3 install torch*
  ```

##### 编译安装

```bash
panning's avatar
panning committed
50
git clone -b dtk-23.10-v0.14.1 http://developer.hpccube.com/codes/aicomponent/vision.git
panning's avatar
panning committed
51
52
53
54
cd vision
PYTORCH_ROCM_ARCH="gfx906;gfx926" python3 setup.py bdist_wheel
pip3 install dist/vision*
```