1.
Traceback (most recent call last):
File "/home/###/Downloads/softmare/pycharm-community-2018.3.2/helpers/pydev/pydevd.py", line 1741, in <module>
main()
File "/home/###/Downloads/softmare/pycharm-community-2018.3.2/helpers/pydev/pydevd.py", line 1735, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/home/###/Downloads/softmare/pycharm-community-2018.3.2/helpers/pydev/pydevd.py", line 1135, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/###/Downloads/softmare/pycharm-community-2018.3.2/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/###/sdb/CODE/ocr/model/crnn识别/train.py", line 12, in <module>
from warpctc_pytorch import CTCLoss
ModuleNotFoundError: No module named 'warpctc_pytorch'
报错原因:CTC+pytorch编译配置warp-CTC;
warp-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
安装过程中遇到的问题:
报错:
c -D_GLIBCXX_USE_CXX11_ABI=0
cc1plus: 警告:command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
src/binding.cpp:10:33: 致命错误:c10/cuda/CUDAGuard.h:没有那个文件或目录
解决方法:
删除 pytorch-binding/src/binding.cpp 中的 #include <c10/cuda/CUDAGuard.h>即可
参考链接:
1.安装参考:https://blog.csdn.net/zzc15806/article/details/83999668
2.报错参考:https://blog.csdn.net/amu76980/article/details/101173862