Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Error while trying to run "webcam.py file of demo" #1112

Open
Fariha1123 opened this issue Sep 27, 2019 · 2 comments
Open

Error while trying to run "webcam.py file of demo" #1112

Fariha1123 opened this issue Sep 27, 2019 · 2 comments

Comments

@Fariha1123
Copy link

Fariha1123 commented Sep 27, 2019

❓ Questions and Help

I followed the install.md provided in git source and #1042, and everything works fine until the build. The build of maskrcnn-benchmark is successful as well.

Now I am trying to run "python webcam.py --help" in demo folder but fall into the following error:

`(maskrcnn-benchmark) D:\work\maskrcnn-benchmark\demo>python webcam.py --help
Traceback (most recent call last):
File "C:\Users\Fariha.Abbasi\AppData\Local\Continuum\anaconda3\envs\maskrcnn-benchmark\lib\site-packages\torch\utils\cpp_extension.py", line 949, in _build_extension_module
check=True)
File "C:\Users\Fariha.Abbasi\AppData\Local\Continuum\anaconda3\envs\maskrcnn-benchmark\lib\subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "webcam.py", line 6, in
from predictor import COCODemo
File "D:\work\maskrcnn-benchmark\demo\predictor.py", line 6, in
from maskrcnn_benchmark.modeling.detector import build_detection_model
File "d:\work\maskrcnn-benchmark\maskrcnn_benchmark\modeling\detector_init_.py", line 2, in
from .detectors import build_detection_model
File "d:\work\maskrcnn-benchmark\maskrcnn_benchmark\modeling\detector\detectors.py", line 2, in
from .generalized_rcnn import GeneralizedRCNN
File "d:\work\maskrcnn-benchmark\maskrcnn_benchmark\modeling\detector\generalized_rcnn.py", line 11, in
from ..backbone import build_backbone
File "d:\work\maskrcnn-benchmark\maskrcnn_benchmark\modeling\backbone_init_.py", line 2, in
from .backbone import build_backbone
File "d:\work\maskrcnn-benchmark\maskrcnn_benchmark\modeling\backbone\backbone.py", line 7, in
from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform
File "d:\work\maskrcnn-benchmark\maskrcnn_benchmark\modeling\make_layers.py", line 10, in
from maskrcnn_benchmark.layers import Conv2d
File "d:\work\maskrcnn-benchmark\maskrcnn_benchmark\layers_init_.py", line 10, in
from .nms import nms
File "d:\work\maskrcnn-benchmark\maskrcnn_benchmark\layers\nms.py", line 2, in
from ._utils import _C
File "d:\work\maskrcnn-benchmark\maskrcnn_benchmark\layers_utils.py", line 39, in
_C = _load_C_extensions()
File "d:\work\maskrcnn-benchmark\maskrcnn_benchmark\layers_utils.py", line 35, in _load_C_extensions
extra_include_paths=extra_include_paths,
File "C:\Users\Fariha.Abbasi\AppData\Local\Continuum\anaconda3\envs\maskrcnn-benchmark\lib\site-packages\torch\utils\cpp_extension.py", line 644, in load
is_python_module)
File "C:\Users\Fariha.Abbasi\AppData\Local\Continuum\anaconda3\envs\maskrcnn-benchmark\lib\site-packages\torch\utils\cpp_extension.py", line 813, in _jit_compile
with_cuda=with_cuda)
File "C:\Users\Fariha.Abbasi\AppData\Local\Continuum\anaconda3\envs\maskrcnn-benchmark\lib\site-packages\torch\utils\cpp_extension.py", line 866, in _write_ninja_file_and_build
_build_extension_module(name, build_directory, verbose)
File "C:\Users\Fariha.Abbasi\AppData\Local\Continuum\anaconda3\envs\maskrcnn-benchmark\lib\site-packages\torch\utils\cpp_extension.py", line 962, in _build_extension_module
raise RuntimeError(message)
RuntimeError: Error building extension 'torchvision': b'[1/1] "c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64/link.exe" vision.o nms_cpu.o ROIAlign_cpu.o deform_conv_cuda.cuda.o deform_conv_kernel_cuda.cuda.o deform_pool_cuda.cuda.o deform_pool_kernel_cuda.cuda.o nms.cuda.o ROIAlign_cuda.cuda.o ROIPool_cuda.cuda.o SigmoidFocalLoss_cuda.cuda.o /nologo /DLL c10.lib caffe2.lib torch.lib torch_python.lib caffe2_gpu.lib _C.lib /LIBPATH:C:\Users\Fariha.Abbasi\AppData\Local\Continuum\anaconda3\envs\maskrcnn-benchmark\libs /LIBPATH:C:\Users\Fariha.Abbasi\AppData\Local\Continuum\anaconda3\envs\maskrcnn-benchmark\lib\site-packages\torch\lib "/LIBPATH:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA\v10.0\lib/x64" cudart.lib /out:torchvision.pyd\r\nFAILED: torchvision.pyd \r\n"c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64/link.exe" vision.o nms_cpu.o ROIAlign_cpu.o deform_conv_cuda.cuda.o deform_conv_kernel_cuda.cuda.o deform_pool_cuda.cuda.o deform_pool_kernel_cuda.cuda.o nms.cuda.o ROIAlign_cuda.cuda.o ROIPool_cuda.cuda.o SigmoidFocalLoss_cuda.cuda.o /nologo /DLL c10.lib caffe2.lib torch.lib torch_python.lib caffe2_gpu.lib _C.lib /LIBPATH:C:\Users\Fariha.Abbasi\AppData\Local\Continuum\anaconda3\envs\maskrcnn-benchmark\libs /LIBPATH:C:\Users\Fariha.Abbasi\AppData\Local\Continuum\anaconda3\envs\maskrcnn-benchmark\lib\site-packages\torch\lib "/LIBPATH:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA\v10.0\lib/x64" cudart.lib /out:torchvision.pyd\r\n Creating library torchvision.lib and object torchvision.exp\r\nROIAlign_cuda.cuda.o : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl c10::cuda::CUDAStream::operator struct CUstream_st *(void)const " (_imp??BCUDAStream@cuda@c10@@QEBAPEAUCUstream_st@@xz) referenced in function "class at::Tensor __cdecl ROIAlign_forward_cuda(class at::Tensor const &,class at::Tensor const &,float,int,int,int)" (?ROIAlign_forward_cuda@@ya?AVTensor@at@@AEBV12@0MHHH@Z)\r\nROIPool_cuda.cuda.o : 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)\r\nSigmoidFocalLoss_cuda.cuda.o : 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)\r\nROIAlign_cuda.cuda.o : error LNK2019: unresolved external symbol "__declspec(dllimport) class c10::cuda::CUDAStream __cdecl c10::cuda::getCurrentCUDAStream(short)" (_imp?getCurrentCUDAStream@cuda@c10@@ya?AVCUDAStream@12@F@Z) referenced in function "class at::Tensor __cdecl ROIAlign_forward_cuda(class at::Tensor const &,class at::Tensor const &,float,int,int,int)" (?ROIAlign_forward_cuda@@ya?AVTensor@at@@AEBV12@0MHHH@Z)\r\nROIPool_cuda.cuda.o : 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)\r\nSigmoidFocalLoss_cuda.cuda.o : 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)\r\ntorchvision.pyd : fatal error LNK1120: 2 unresolved externals\r\nninja: build stopped: subcommand failed.\r\n'`

Please suggest what shall I do to fix it?

P.S: Cuda = 10.0
Python = 3.6.7
Pytorch = 1.1.0 stable

@laplaceson
Copy link

Same issue . Do you solve this?

@imzhangyd
Copy link

@Fariha1123 I had the same problem. Did you solve it?

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

No branches or pull requests

3 participants