-
Notifications
You must be signed in to change notification settings - Fork 2.5k
maskrcnn benchmark error #547
Comments
Sorry, I have no experience with Windows. |
I had the same issue with the only difference being that I'm using Cuda 10.0 After some digging I discovered that c10_cuda.lib is missing from the linking call and the symbols needed are present in c10_cuda.dll. I was able to add c10_cuda.lib as an extra linker argument in setup.py and build successfully. |
@septentriones Would you let us know exactly how did you do it? I tried for an hour, but had no luck so far. Any dirty hack is welcome :) Thanks. |
Sure. I was also working through some other compile issues (among other changes I had to cast to long in SigmoidFocalLuss_cuda.cu as in this previous commit) and tried a number of fixes. Currently my setup.py includes the changes suggested here and additionally has 'c10_cuda.lib' as an argument for extra_link_args. In summary I added:
and modified the ext_modules as:
I hope that works for you too! Note: What led me to figuring this out was looking for the missing symbols in c10.lib and eventually c10_cuda.lib using dumpbin and undname from the VS console. |
Thanks really a lot for the extensive response. It doesn't work for me yet, but I think I messed up something, because I could get the linker working earlier with modifying the command manually - and that doesn't work now either :) Will be back with the results later :) |
Reinstalled conda environment with pytorch nightly and philferriere's coco and finally it compiles, thanks!!! Messed up my files somehow. One thing to mention is that besides those links you mentioned (they guided me also), is that at the moment all three *.cu files needs to be changed, with long declarations: long ceil_div(long a, long b) { I'll try to post a more extensive guide. |
I'm glad you finally got it working! As you mention, I did also use pytorch nightly and philferrier's coco. I only needed to change the one *.cu file I mentioned earlier though because the other two *.cu files already had the change (but is important to make sure that all three are modified similarly). Cheers! |
Hmm, I don't see that there are changed in the master repo. I need to change all three of them. Thanks a lot again! |
Full guide for install
CUDA
Visual Studio and friends
Restart your computer at this point in any case. Anaconda
PyTorch solution
Time for a beer. It works on 2019.03.23, if you are from the future, you will have another battle, but hopefully this will make it easier. Notes:
Re-launch and press CTRL+Shift+R in browser. Clear cache, and repeat relaunching with CTRL+Shift+R if still empty. |
@fmassa ^^^ Francisco, this might be interesting to you aswell. Thanks a lot to you guys for the great job! |
Updated the guide, CuDNN was not working as per the initial description. |
@bpfliegel Hi, I follow your steps and got the error as below:
How to fix it? |
In case anyone else is trying this in 2021: #547 (comment)
In case anyone else is trying this in 2021:
With this:
Make sure you have the following versions:
This worked for me on 2021.03.16 on my Windows 10. |
win10+anaconda3+python3.7.2+cuda9.0
ROIAlign_cuda.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl c10::cuda::CUDAStream::operator struct CUstream_st *(void)const " (_imp??BCUDAStream@cuda@c10@@QEBAPEAUCUstream_st@@xz)
ROIPool_cuda.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl c10::cuda::CUDAStream::operator struct CUstream_st *(void)const " (_imp??BCUDAStream@cuda@c10@@QEBAPEAUCUstream_st@@xz)
SigmoidFocalLoss_cuda.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl c10::cuda::CUDAStream::operator struct CUstream_st *(void)const " (_imp??BCUDAStream@cuda@c10@@QEBAPEAUCUstream_st@@xz)
ROIAlign_cuda.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class c10::cuda::CUDAStream __cdecl c10::cuda::getCurrentCUDAStream(short)" (_imp?getCurrentCUDAStream@cuda@c10@@ya?AVCUDAStream@12@F@Z)
ROIPool_cuda.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class c10::cuda::CUDAStream __cdecl c10::cuda::getCurrentCUDAStream(short)" (_imp?getCurrentCUDAStream@cuda@c10@@ya?AVCUDAStream@12@F@Z)
SigmoidFocalLoss_cuda.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class c10::cuda::CUDAStream __cdecl c10::cuda::getCurrentCUDAStream(short)" (_imp?getCurrentCUDAStream@cuda@c10@@ya?AVCUDAStream@12@F@Z)
build\lib.win-amd64-3.7\maskrcnn_benchmark_C.cp37-win_amd64.pyd : fatal error LNK1120: 2 unresolved externals
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe' failed with exit status 1120
have someone ever met? I would appreciate it if you could give me some advice.
The text was updated successfully, but these errors were encountered: