#
PyTorch Spline Conv
## 简介
Pytorch Spline Conv 是 SplineCNN 的基于样条的卷积算子
### 使用pip方式安装
pytorch-spline-conv whl包下载目录:[http://10.6.10.68:8000/customized/torch-spline-conv/dtk2310](http://10.6.10.68:8000/customized/torch-spline-conv/dtk2310). 目前只提供有python3.8版本的安装包
```shell
pip install torch_spline_conv* (下载的torch_spine_conv的whl包)
```
### 使用源码编译方式安装
#### 编译环境准备
- 安装相关依赖
```shell
pip install numpy
pip install 'urllib3==1.26.14'
pip install pytest
pip insta;; wheel
```
- 在首页 | 光合开发者社区下载 det23.10 解压在 /opt/ 路径下,并建立软连接,例如
```shell
cd /opt
wget http://10.6.10.68:8000/dtk-release/dtk23.10/CentOS7.6/DTK-23.10-CentOS7.6-x86_64.tar.gz
tar -zxvf DTK-23.10-CentOS7.6-x86_64.tar.gz
ln -s dtk-23.10 dtk
source /opt/dtk/env.sh
```
- 安装pytorch. pytorch whl包下载目录: [http://10.6.10.68:8000/debug/pytorch/dtk23.10/hipify](http://10.6.10.68:8000/debug/pytorch/dtk23.10/hipify). 根据需求下载对应的版本,安装如下:
```shell
pip install torch* (下载的torch的whl包)
```
#### 源码下载编译安装
```shell
git clone -b 1.2.1-release http://developer.hpccube.com/codes/aicomponent/torch-spline-conv.git
python pymap_script.py /path/to/torch-spline-conv
cd torch-spline-conv
python setup.py bdist_wheel
pip install dist/*.whl
```
## 单侧
```shell
cd torch-spline-conv
python setup.py test
```
## Known Issue
完成安装进行单测时,会报错ImportError: Could not find module '_version_cpu' ~,在根目录/下查找一下,然后把库文件目录添加一下软链接即可。
```
find / -name "_version_cpu.so"
cd /torch_spline_conv/torch_spline_conv
ln -s /usr/local/lib/python3.8/site-packages/torch_spline_conv/* .
```
## 参考资料
```shell
https://github.com/rusty1s/pytorch_spline_conv
```