2019.1.21更新。不需要安装太多依赖库
pip install -r requirements.txt 即可。其中有(但我的torch安装不上)
torch==0.4.0
torchvision
visdom
nibabel
pandas
tqdm
matplotlib
opencv-python
ntpath
有些安装ntpath出问题,这是用于视频演示的,而且不是必要项。作者回应可以根据#153需要还原它。
那不然可以试试单独安装试试看:https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/ntpath/
走了好多弯路啊~~~
1.alphapose
1)Get the code.
git clone -b pytorch https://github.com/MVIG-SJTU/AlphaPose.git
2)Install pytorch 源码安装(命令行安装见2)
chmod +x install.sh
./install.sh
3)Download the models manually: duc_se.pth (Google Drive | Baidu pan), yolov3.weights(Google Drive | Baidu pan). Place them into ./models/sppe
and ./models/yolo
respectively.
2.PyTorch
一定要是0.4.0版本,因为'no_grad'是后来才添加的。 module 'torch' has no attribute 'no_grad'
#查看版本
import torch
print(torch.__version__)
注意:这里可选择CPU版本还是GPU版本,GPU要安装CUDA,CUDNN。见pytorch各个版本安装指令
2.1可以直接用conda安装,建议用这种方法:
conda install pytorch==0.4.0 torchvision cuda80 -c pytorch
执行命令后可以看到对应的版本说明。要把各个版本一致。
cuda80: 1.0-h205658b_0 pytorch
cudatoolkit: 8.0-3 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
ninja: 1.8.2-py36h6bb024c_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pytorch: 0.4.1-py36_cuda8.0.61_cudnn7.1.2_1 pytorch [cuda80]
torchvision: 0.2.1-py36_1 &nb