baidu-research / warp-ctc

Fast parallel CTC.
Apache License 2.0
4.07k stars 1.04k forks source link

python setup.py install with error #125

Open carlhung opened 6 years ago

carlhung commented 6 years ago

python setup.py install generating build/warpctc_pytorch/_warp_ctc/warp_ctc.c (already up-to-date) not modified: 'build/warpctc_pytorch/_warp_ctc/warp_ctc.c' running install running bdist_egg running egg_info writing warpctc_pytorch.egg-info/PKG-INFO writing dependency_links to warpctc_pytorch.egg-info/dependency_links.txt writing top-level names to warpctc_pytorch.egg-info/top_level.txt reading manifest file 'warpctc_pytorch.egg-info/SOURCES.txt' writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py copying warpctc_pytorch/_warp_ctc/init.py -> build/lib.linux-x86_64-3.6/warpctc_pytorch/_warp_ctc running build_ext building 'warpctc_pytorch._warp_ctc.warp_ctc' extension gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -m64 -fPIC -m64 -fPIC -fPIC -I/home/carlhung/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/carlhung/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/carlhung/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/home/carlhung/warp-ctc/include -I/home/carlhung/anaconda3/envs/fastai/include/python3.6m -c build/warpctc_pytorch/_warp_ctc/warp_ctc.c -o build/temp.linux-x86_64-3.6/build/warpctc_pytorch/_warp_ctc/__warp_ctc.o -std=c++11 -fPIC -std=c99 -DWARPCTC_ENABLE_GPU cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -m64 -fPIC -m64 -fPIC -fPIC -I/home/carlhung/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/carlhung/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/carlhung/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/home/carlhung/warp-ctc/include -I/home/carlhung/anaconda3/envs/fastai/include/python3.6m -c /home/carlhung/warp-ctc/pytorch_binding/src/binding.cpp -o build/temp.linux-x86_64-3.6/home/carlhung/warp-ctc/pytorch_binding/src/binding.o -std=c++11 -fPIC -std=c99 -DWARPCTC_ENABLE_GPU cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not for C++ /home/carlhung/warp-ctc/pytorch_binding/src/binding.cpp: In function ‘int gpu_ctc(THCudaTensor, THCudaTensor, THIntTensor, THIntTensor, THIntTensor, int, THFloatTensor, int)’: /home/carlhung/warp-ctc/pytorch_binding/src/binding.cpp:92:49: error: cannot convert ‘THCudaTensor’ to ‘const THFloatTensor’ for argument ‘1’ to ‘int64_t THFloatTensor_size(const THFloatTensor*, int)’ int probs_size = THFloatTensor_size(probs, 2); ^ /home/carlhung/warp-ctc/pytorch_binding/src/binding.cpp:105:61: error: invalid conversion from ‘size_t {aka long unsigned int}’ to ‘void’ [-fpermissive] void gpu_workspace = THCudaMalloc(state, gpu_size_bytes); ^ /home/carlhung/warp-ctc/pytorch_binding/src/binding.cpp:105:61: error: too few arguments to function ‘cudaError_t THCudaMalloc(THCState, void, size_t)’ In file included from /home/carlhung/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:4:0, from /home/carlhung/warp-ctc/pytorch_binding/src/binding.cpp:9: /home/carlhung/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGeneral.h:205:21: note: declared here THC_API cudaError_t THCudaMalloc(THCState *state, void **ptr, size_t size); ^~~~ error: command 'gcc' failed with exit status 1

carlhung commented 6 years ago

sorry, wrong post. can please remove this post.

hdeping commented 6 years ago

So you have solved this?

I had this problem too, so I solved it in https://github.com/SeanNaren/warp-ctc/issues/83 However, there is wrong when I run test_gpu.py. So I am wondering if you have better solution.

leeivan1007 commented 6 years ago

i have same problem

THC_API cudaError_t THCudaMalloc(THCState *state, void **ptr, size_t size)

ghostliu commented 5 years ago

并没有解决。。。。

1LOVESJohnny commented 5 years ago

Hey guys, I've found a solution. source answer: https://www.jianshu.com/p/e948f44c6b37

`Error info: THC_API cudaError_t THCudaMalloc(THCState *state, void **ptr, size_t size); error: command 'x86_64-linux-gnu-gcc' failed with exit status 1.

Modification: 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);`

Done ^___^