pip install graph-learn
我们以Ubuntu 16.04
下基于g++ 5.4.0
为例, 来说明源码编译的步骤。
sudo apt-get install git-all
sudo apt-get install autoconf automake libtool libssl-dev cmake python-numpy python-setuptools python-pip
首先,下载源代码:
git clone https://github.com/alibaba/graph-learn.git
cd graph-learn
git submodule update --init
接着,可以使用如下两种方式编译整个项目及测试用例:
- 使用Makefile:
make test
- 使用CMakeLists.txt:
mkdir cmake-build && cd cmake-build
cmake -DTESTING=ON .. && make
最后,编译python包,同时支持python2,python3:
make python
如需要执行特定的python bin,如指定用python3.7编译,则执行:
make python PYTHON=python3.7
sudo pip install dist/your_wheel_name.whl
GL提供的Tensorflow模型示例基于TensorFlow 1.13开发,需要安装对应版本的库。
sudo pip install tensorflow==1.13.0
GL提供的PyTorch模型示例基于PyG开发,需要安装对应的库。
sudo pip install pytorch
# Install PyG follow the doc: https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html
source env.sh
./test_cpp_ut.sh
./test_python_ut.sh
我们提供了graphlearn的镜像,预装了对应版本的graphlearn。
根据算法开发的需求,分别提供预装Tensorflow1.13.0rc1和Pytorch1.8.1+PyG的镜像。
您可以在Docker镜像中快速开始GraphLearn的运行。
- Tensorflow1.13.0rc1, CPU
docker pull graphlearn/graphlearn:1.0.0-tensorflow1.13.0rc1-cpu
# or, pull the latest graphlearn with 1.0.0-tensorflow1.13.0rc1-cpu
docker pull graphlearn/graphlearn:latest
# or, pull the given version graphlearn with 1.0.0-tensorflow1.13.0rc1-cpu
docker pull graphlearn/graphlearn:1.0.0
- PyTorch1.8.1, Cuda10.2, cdnn7, with PyG
docker pull graphlearn/graphlearn:1.0.0-torch1.8.1-cuda10.2-cudnn7