ubuntu16.04下pytorch0.4+ctc配置

1、创建pytorch环境

conda create -n pytorch python=3.6

2、安装pytorch0.4

conda install pytorch=0.4.0 cuda80 -c pytorch

3、编译ctc

git clone https://github.com/SeanNaren/warp-ctc.git
cd warp-ctc
mkdir build; cd build
cmake ..
make

编译过程中会一般不会出现问题,

cd pytorch_binding
python setup.py install

这个过程会出现问题:

/home/sobhe/repo/warp-ctc/pytorch_binding/src/binding.cpp:105:61: error: too few arguments to function ‘cudaError_t THCudaMalloc(THCState*, void**, size_t)

修改文件 "pytorch_binding/src/binding.cpp"
1 at 92 line
int probs_size = THCudaTensor_size(state, probs, 2);
2 at l05 lines
void* gpu_workspace;
THCudaMalloc(state, &gpu_workspace, gpu_size_bytes);

再次运行:

cd pytorch_binding

python setup.py install

恭喜你,成功了

 

你可能感兴趣的:(人工智能)