Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pybind.obj : error LNK2001: 无法解析的外部符号 "class at::Tensor __cdecl nms_rotated(class at::Tensor,c lass at::Tensor,class at::Tensor,class at::Tensor,float,int)" (?nms_rotated@@YA?AVTensor@at@@V12@V12@11MH@Z) #709

Closed
ouening opened this issue Dec 13, 2020 · 16 comments · Fixed by #728
Assignees
Labels

Comments

@ouening
Copy link

ouening commented Dec 13, 2020

OS: Win10
VS: 2019 (19.28.29335)
mmcv: 1.2.1
CUDA: 11.0
pytorch: 1.7.1
Python: 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)]

本人编译mmcv-full的环境介绍如上,但是出现了以下错误:

  正在创建库 E:\Downloads\mmcv-1.2.1\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\_ext.cp38
-win_amd64.lib 和对象 E:\Downloads\mmcv-1.2.1\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\
_ext.cp38-win_amd64.exp
pybind.obj : error LNK2001: 无法解析的外部符号 "class at::Tensor __cdecl nms_rotated(class at::Tensor,c
lass at::Tensor,class at::Tensor,class at::Tensor,float,int)" (?nms_rotated@@YA?AVTensor@at@@V12@V12@11MH@Z)
  已定义且可能匹配的符号上的提示:
    "class at::Tensor __cdecl nms_rotated(class at::Tensor,class at::Tensor,class at::Tensor,class at::Tensor,float,int)" (?nms_rotated@@YA?AVTensor@at@@V12@000MH@Z)
build\lib.win-amd64-3.8\mmcv\_ext.cp38-win_amd64.pyd : fatal error LNK1120: 1 个无法解析的外部命令
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\link.exe' failed with exit status 1120

看提示好像是link.exe的问题,奇怪的是编译的时候host是x86,不知道是不是这个问题,但是试了一下没有找到build_ext时手动设置msvc的host的方法,请问有人在Windows下成功编译了mmcv-full了吗?mmdetection依赖这个,否则用不了

@wangruohui
Copy link
Member

Hello,

Please see if this modification solves your problem. It is based on version v1.2.2 .

@ouening
Copy link
Author

ouening commented Dec 17, 2020

I have tried but unfortunately the error still happened:

[40/40] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin\nvcc --use-local-env -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -DMMCV_WITH_CUDA -ID:\Github\mmcv\mmcv\ops\csrc -ID:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\torch\include -ID:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\torch\include\torch\csrc\api\include -ID:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\torch\include\TH -ID:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" -ID:\Applications\WPy64-3850\python-3.8.5.amd64\include -ID:\Applications\WPy64-3850\python-3.8.5.amd64\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IE:\Windows Kits\10\include\10.0.18362.0\ucrt" "-IE:\Windows Kits\10\include\10.0.18362.0\shared" "-IE:\Windows Kits\10\include\10.0.18362.0\um" "-IE:\Windows Kits\10\include\10.0.18362.0\winrt" "-IE:\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include" -ID:\Applications\MKL\compilers_and_libraries_2020.4.311\windows\mkl\include "-IE:\Windows Kits\10\Include\10.0.18362.0\ucrt" "-IE:\Windows Kits\10\Include\10.0.18362.0\um" "-IE:\Windows Kits\10\Include\10.0.18362.0\shared" "-IE:\Windows Kits\10\Include\10.0.18362.0\winrt" -c D:\Github\mmcv\mmcv\ops\csrc\pytorch\tin_shift_cuda.cu -o D:\Github\mmcv\build\temp.win-amd64-3.8\Release\mmcv/ops/csrc/pytorch\tin_shift_cuda.obj -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75
tin_shift_cuda.cu
creating D:\Github\mmcv\build\lib.win-amd64-3.8
creating D:\Github\mmcv\build\lib.win-amd64-3.8\mmcv
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\torch\lib "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\lib/x64" /LIBPATH:D:\Applications\WPy64-3850\python-3.8.5.amd64\libs /LIBPATH:D:\Applications\WPy64-3850\python-3.8.5.amd64\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:E:\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "/LIBPATH:E:\Windows Kits\10\lib\10.0.18362.0\um\x64" "/LIBPATH:E:\Windows Kits\10\Lib\10.0.18362.0\um\x64" "/LIBPATH:E:\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\lib\x64" /LIBPATH:D:\Applications\MKL\compilers_and_libraries_2020.4.311\windows\mkl\lib\intel64 /LIBPATH:D:\Applications\MKL\compilers_and_libraries_2020.4.311\windows\compiler\lib\intel64 c10.lib torch.lib torch_cpu.lib torch_python.lib cudart.lib c10_cuda.lib torch_cuda.lib /EXPORT:PyInit__ext D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\bbox_overlaps.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\bbox_overlaps_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\box_iou_rotated.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\box_iou_rotated_cpu.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\box_iou_rotated_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\carafe.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\carafe_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\carafe_naive.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\carafe_naive_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\cc_attention.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\cc_attention_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\corner_pool.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\deform_conv.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\deform_conv_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\deform_roi_pool.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\deform_roi_pool_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\focal_loss.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\focal_loss_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\info.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\masked_conv2d.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\masked_conv2d_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\modulated_deform_conv.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\modulated_deform_conv_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\nms.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\nms_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\nms_rotated.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\nms_rotated_cpu.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\nms_rotated_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\psamask.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\psamask_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\pybind.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\roi_align.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\roi_align_cpu.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\roi_align_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\roi_pool.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\roi_pool_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\sync_bn.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\sync_bn_cuda.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\tin_shift.obj D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\tin_shift_cuda.obj /OUT:build\lib.win-amd64-3.8\mmcv\_ext.cp38-win_amd64.pyd /IMPLIB:D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\_ext.cp38-win_amd64.lib
  正在创建库 D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\_ext.cp38-win_amd64.lib 和对象 D:\Github\mmcv\build\temp.win-amd64-3.8\Release\./mmcv/ops/csrc/pytorch\_ext.cp38-win_amd64.exp

pybind.obj : error LNK2001: 无法解析的外部符号 "class at::Tensor __cdecl nms_rotated(class at::Tensor,class at::Tensor,class at::Tensor,class at::Tensor,float,int)" (?nms_rotated@@YA?AVTensor@at@@V12@V12@11MH@Z)

  已定义且可能匹配的符号上的提示:
    "class at::Tensor __cdecl nms_rotated(class at::Tensor,class at::Tensor,class at::Tensor,class at::Tensor,float,int)" (?nms_rotated@@YA?AVTensor@at@@V12@000MH@Z)
build\lib.win-amd64-3.8\mmcv\_ext.cp38-win_amd64.pyd : fatal error LNK1120: 1 个无法解析的外部命令
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\link.exe' failed with exit status 1120

@wangruohui
Copy link
Member

Try remove the build folder (D:\Github\mmcv\build) and rebuild?

@wangruohui
Copy link
Member

wangruohui commented Dec 17, 2020

Also, as a workaround, if nms_rotate is not a must, you can try removing related codes (at last lines) in ops\csrc\pytorch\pybind.cpp and rebuild the extension.

  m.def("nms_rotated", &nms_rotated, "NMS for rotated boxes", py::arg("dets"),
        py::arg("scores"), py::arg("order"), py::arg("dets_sorted"),
        py::arg("iou_threshold"), py::arg("multi_label"));

But I think the problem lies here.

@ouening
Copy link
Author

ouening commented Dec 17, 2020

Thank you! I'll try later. Does it affect mmdetection training?

@wangruohui
Copy link
Member

I think no.

Moreover, I upload the compiled wheel package here (miniconda with python 3.8, torch 1.7, cuda 11.0.3). You can also try pip install this package directly.

mmcv_full-1.2.2-cp38-cp38-win_amd64.zip

@ouening
Copy link
Author

ouening commented Dec 17, 2020

Thank you very much! I have successfully installed mmdetection and passed the verification:

from mmdet.apis import init_detector, inference_detector

config_file = 'configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'
# Get from http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth
ckpt = `faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth`
device = 'cuda:0'
# init a detector
model = init_detector(config_file, ckpt, device=device)
# inference the demo image
inference_detector(model, 'demo/demo.jpg')

Next time I will try to train my own dataset to see whether it work properly.

@ouening
Copy link
Author

ouening commented Dec 18, 2020

In my computer I have successfully trained my own datasets.

But when I configured in another computer (CUDA10.2, Win10, Python3.8, pytorch1.7.1), the error still occured. I tried some ways:

  1. First installed the prebuild mmcv-full, then install mmdetection-2.7.0 in develop model, the error is:
Traceback (most recent call last):
  File "tools/train.py", line 15, in <module>
    from mmdet.apis import set_random_seed, train_detector
  File "d:\lw\mmdetection-2.7.0\mmdet\apis\__init__.py", line 1, in <module>
    from .inference import (async_inference_detector, inference_detector,
  File "d:\lw\mmdetection-2.7.0\mmdet\apis\inference.py", line 7, in <module>
    from mmcv.ops import RoIPool
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\ops\__init__.py", line 1, in <module>
    from .bbox import bbox_overlaps
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\ops\bbox.py", line 3, in <module>
    ext_module = ext_loader.load_ext('_ext', ['bbox_overlaps'])
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\utils\ext_loader.py", line 11, in load_ext
    ext = importlib.import_module('mmcv.' + name)
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed while importing _ext: 找不到指定的模块。
  1. Tried to build the modified mmcv-full from source, still failed, evan I uncomment the codes
m.def("nms_rotated", &nms_rotated, "NMS for rotated boxes", py::arg("dets"),
        py::arg("scores"), py::arg("order"), py::arg("dets_sorted"),
        py::arg("iou_threshold"), py::arg("multi_label"));

@ouening
Copy link
Author

ouening commented Dec 18, 2020

I reinstalled cuda11 and pytorch1.7.1+cu110, now I have accounted another problem when I excute the training script:

Traceback (most recent call last):
  File "tools/train.py", line 181, in <module>
    main()
  File "tools/train.py", line 170, in main
    train_detector(
  File "d:\lw\mmdetection-2.7.0\mmdet\apis\train.py", line 150, in train_detector
    runner.run(data_loaders, cfg.workflow, cfg.total_epochs)
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\runner\epoch_based_runner.py", line 125, in run
    epoch_runner(data_loaders[i], **kwargs)
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\runner\epoch_based_runner.py", line 50, in train
    self.run_iter(data_batch, train_mode=True)
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\runner\epoch_based_runner.py", line 29, in run_iter
    outputs = self.model.train_step(data_batch, self.optimizer,
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\parallel\data_parallel.py", line 67, in train_step
    return self.module.train_step(*inputs[0], **kwargs[0])
  File "d:\lw\mmdetection-2.7.0\mmdet\models\detectors\base.py", line 246, in train_step
    losses = self(**data)
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\runner\fp16_utils.py", line 84, in new_func
    return old_func(*args, **kwargs)
  File "d:\lw\mmdetection-2.7.0\mmdet\models\detectors\base.py", line 180, in forward
    return self.forward_train(img, img_metas, **kwargs)
  File "d:\lw\mmdetection-2.7.0\mmdet\models\detectors\two_stage.py", line 150, in forward_train
    rpn_losses, proposal_list = self.rpn_head.forward_train(
  File "d:\lw\mmdetection-2.7.0\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 "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\runner\fp16_utils.py", line 164, in new_func
    return old_func(*args, **kwargs)
  File "d:\lw\mmdetection-2.7.0\mmdet\models\dense_heads\anchor_head.py", line 568, in get_bboxes
    proposals = self._get_bboxes_single(cls_score_list,
  File "d:\lw\mmdetection-2.7.0\mmdet\models\dense_heads\rpn_head.py", line 167, in _get_bboxes_single
    dets, keep = batched_nms(proposals, scores, ids, nms_cfg)
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\ops\nms.py", line 259, in batched_nms
    dets, keep = nms_op(boxes_for_nms, scores, **nms_cfg_)
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\utils\misc.py", line 310, in new_func
    output = old_func(*args, **kwargs)
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\ops\nms.py", line 113, in nms
    inds = NMSop.apply(boxes, scores, iou_threshold, offset)
  File "D:\Applications\WPy64-3850\python-3.8.5.amd64\lib\site-packages\mmcv\ops\nms.py", line 18, in forward
    inds = ext_module.nms(
RuntimeError: CUDA error: no kernel image is available for execution on the device

@wangruohui
Copy link
Member

wangruohui commented Dec 18, 2020

What GPU do you use? I compiled cuda code for sm61 (GTX 10xx GPUs) target only.

The package can be compiled to support all GPUs but only for specific vertion of python, pytorch and cuda. So if you change either of them you need a recompilation the package.

Moreover, the modification I mentioned in the previous reply means that you need to first clone my fork and then checkout to the fixed branch. The master version is NOT fixed.

Which meas you need to first

git clone https://github.com/wangruohui/mmcv.git

and then

git checkout fix_nms_rorate

and then launch compilation. Did you remember to checkout to correct branch?

@ouening
Copy link
Author

ouening commented Dec 18, 2020

Both of the two computers' GPU are RTX 2080. In my computer it works, but the other does not (same CUDA, VS2019, pytorch, python). I think the problem is mainly in mmcv-full package.

@ouening
Copy link
Author

ouening commented Dec 18, 2020

My mistake! I haven't changed the branch before. It can be compiled using the branch fix_nms_rorate. And for now it seems to work fine.

@del-zhenwu
Copy link
Collaborator

del-zhenwu commented Nov 24, 2021

I have the same error during the installation:

13:18:53    正在创建库 C:\Workspace\Jenkins\workspace\mmcv\build-on-windows-58e3242@2\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\_ext.cp37-win_amd64.lib 和对象 C:\Workspace\Jenkins\workspace\mmcv\build-on-windows-58e3242@2\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\_ext.cp37-win_amd64.exp
13:18:53  pybind.obj : error LNK2001: 无法解析的外部符号 "int __cdecl iou3d_nms_forward(class at::Tensor,class at::Tensor,class at::Tensor,float)" (?iou3d_nms_forward@@YAHVTensor@at@@00M@Z)
13:18:53    已定义且可能匹配的符号上的提示:
13:18:53      "void __cdecl iou3d_nms_forward(class at::Tensor,class at::Tensor,class at::Tensor,float)" (?iou3d_nms_forward@@YAXVTensor@at@@00M@Z)
13:18:53  pybind.obj : error LNK2001: 无法解析的外部符号 "int __cdecl iou3d_nms_normal_forward(class at::Tensor,class at::Tensor,class at::Tensor,float)" (?iou3d_nms_normal_forward@@YAHVTensor@at@@00M@Z)
13:18:53    已定义且可能匹配的符号上的提示:
13:18:53      "void __cdecl iou3d_nms_normal_forward(class at::Tensor,class at::Tensor,class at::Tensor,float)" (?iou3d_nms_normal_forward@@YAXVTensor@at@@00M@Z)
13:18:53  build\lib.win-amd64-3.7\mmcv\_ext.cp37-win_amd64.pyd : fatal error LNK1120: 2 个无法解析的外部命令
13:18:53  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\link.exe' failed with exit status 1120
13:18:53  Python setup.py build_ext failed.

here is the environment info:

mmcvv1.3.18_cuda102_py37_torch1.9.0

on Windows 10, vs2019. MSVC\14.29.30133

@zhouzaida
Copy link
Collaborator

I have the same error during the installation:

13:18:53    正在创建库 C:\Workspace\Jenkins\workspace\mmcv\build-on-windows-58e3242@2\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\_ext.cp37-win_amd64.lib 和对象 C:\Workspace\Jenkins\workspace\mmcv\build-on-windows-58e3242@2\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\_ext.cp37-win_amd64.exp
13:18:53  pybind.obj : error LNK2001: 无法解析的外部符号 "int __cdecl iou3d_nms_forward(class at::Tensor,class at::Tensor,class at::Tensor,float)" (?iou3d_nms_forward@@YAHVTensor@at@@00M@Z)
13:18:53    已定义且可能匹配的符号上的提示:
13:18:53      "void __cdecl iou3d_nms_forward(class at::Tensor,class at::Tensor,class at::Tensor,float)" (?iou3d_nms_forward@@YAXVTensor@at@@00M@Z)
13:18:53  pybind.obj : error LNK2001: 无法解析的外部符号 "int __cdecl iou3d_nms_normal_forward(class at::Tensor,class at::Tensor,class at::Tensor,float)" (?iou3d_nms_normal_forward@@YAHVTensor@at@@00M@Z)
13:18:53    已定义且可能匹配的符号上的提示:
13:18:53      "void __cdecl iou3d_nms_normal_forward(class at::Tensor,class at::Tensor,class at::Tensor,float)" (?iou3d_nms_normal_forward@@YAXVTensor@at@@00M@Z)
13:18:53  build\lib.win-amd64-3.7\mmcv\_ext.cp37-win_amd64.pyd : fatal error LNK1120: 2 个无法解析的外部命令
13:18:53  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\link.exe' failed with exit status 1120
13:18:53  Python setup.py build_ext failed.

here is the environment info:

mmcvv1.3.18_cuda102_py37_torch1.9.0

on Windows 10, vs2019. MSVC\14.29.30133

fixed by #1524

@ParlamLiao
Copy link

same problem need help

@PINKCONCRETE
Copy link

I have same problem, while my GPU is RTX4060

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants