hikopensource / DAVAR-Lab-OCR

OCR toolbox from Davar-Lab
Apache License 2.0
742 stars 156 forks source link

RuntimeError: nms is not compiled with GPU support #139

Open ZHEGG opened 1 year ago

ZHEGG commented 1 year ago

I try to install this environment and skip the line[26:] which is responding to tp&east postprocessing and wrap-ctc module but a new error occur and I found my MMCV CUDA Compiler: not available, the log is below

2023-01-29 15:11:37,122 - davarocr - INFO - Environment info:

sys.platform: linux Python: 3.7.0 (default, Oct 9 2018, 10:31:47) [GCC 7.3.0] CUDA available: True GPU 0: Tesla V100-SXM2-32GB CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 10.2, V10.2.89 GCC: gcc (GCC) 7.3.0 PyTorch: 1.8.2+cu102 PyTorch compiling details: PyTorch built with:

TorchVision: 0.9.2+cu102 OpenCV: 4.7.0 MMCV: 1.3.4 MMCV Compiler: GCC 7.3 MMCV CUDA Compiler: not available DAVAROCR: 0.6.0+49614e4

and then

Traceback (most recent call last): File "/home/zhenghuapeng/.vscode-server/extensions/ms-python.python-2022.20.2/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py", line 3489, in main() File "/home/zhenghuapeng/.vscode-server/extensions/ms-python.python-2022.20.2/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py", line 3482, in main globals = debugger.run(setup['file'], None, None, is_module) File "/home/zhenghuapeng/.vscode-server/extensions/ms-python.python-2022.20.2/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py", line 2510, in run return self._exec(is_module, entry_point_fn, module_name, file, globals, locals) File "/home/zhenghuapeng/.vscode-server/extensions/ms-python.python-2022.20.2/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py", line 2517, in _exec globals = pydevd_runpy.run_path(file, globals, 'main') File "/home/zhenghuapeng/.vscode-server/extensions/ms-python.python-2022.20.2/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 322, in run_path pkg_name=pkg_name, script_name=fname) File "/home/zhenghuapeng/.vscode-server/extensions/ms-python.python-2022.20.2/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 136, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/home/zhenghuapeng/.vscode-server/extensions/ms-python.python-2022.20.2/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code exec(code, run_globals) File "tools/train.py", line 255, in main() File "tools/train.py", line 251, in main meta=meta) File "/home/zhenghuapeng/wubianzhe/DAVAR-Lab-OCR/davarocr/davar_common/apis/train.py", line 180, in train_model runner.run(data_loaders, cfg.workflow) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 125, in run epoch_runner(data_loaders[i], kwargs) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 50, in train self.run_iter(data_batch, train_mode=True, kwargs) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 30, in run_iter kwargs) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmcv/parallel/distributed.py", line 51, in train_step output = self.module.train_step(inputs[0], kwargs[0]) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmdet/models/detectors/base.py", line 247, in train_step losses = self(data) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, kwargs) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 95, in new_func return old_func(args, kwargs) File "/home/zhenghuapeng/wubianzhe/DAVAR-Lab-OCR/davarocr/davar_spotting/models/spotters/base/base.py", line 68, in forward return self.forward_train(img, img_metas, kwargs) File "/home/zhenghuapeng/wubianzhe/DAVAR-Lab-OCR/davarocr/davar_ie/models/infor_extrators/trie/trie.py", line 192, in forward_train proposal_cfg=proposal_cfg) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmdet/models/dense_heads/base_dense_head.py", line 58, in forward_train proposal_list = self.get_bboxes(outs, img_metas, cfg=proposal_cfg) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 182, in new_func return old_func(args, kwargs) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmdet/models/dense_heads/anchor_head.py", line 582, in get_bboxes scale_factors, cfg, rescale) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmdet/models/dense_heads/rpn_head.py", line 234, in _get_bboxes cfg.nms) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmcv/ops/nms.py", line 279, in batched_nms dets, keep = nms_op(boxes_for_nms, scores, nmscfg) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmcv/utils/misc.py", line 310, in new_func output = old_func(args, **kwargs) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmcv/ops/nms.py", line 144, in nms inds = NMSop.apply(boxes, scores, iou_threshold, offset) File "/home/zhenghuapeng/anaconda3/envs/davar/lib/python3.7/site-packages/mmcv/ops/nms.py", line 20, in forward bboxes, scores, iou_threshold=float(iou_threshold), offset=offset) RuntimeError: nms is not compiled with GPU support

I dont know how to solve it, please help, thanks!

qiaoliang6 commented 1 year ago

It looks like cuda and GPU don't match. Search the problem on the Internet to see if there are any similar cases.

After restablishing the environment, the entire project needs to be recompiled for the new environment