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

RuntimeError when running the Tracktor inference code #131

Closed
shwoo93 opened this issue Apr 8, 2021 · 5 comments
Closed

RuntimeError when running the Tracktor inference code #131

shwoo93 opened this issue Apr 8, 2021 · 5 comments

Comments

@shwoo93
Copy link

shwoo93 commented Apr 8, 2021

Describe the bug
A clear and concise description of what the bug is.

I get the runtime error when running the tractor inference code.
Seems like there are several empty boxes in public detections.
I used tracktor_faster-rcnn_r50_fpn_4e_mot17-public.py config file for inference.

Reproduction

  1. What command or script did you run?
tools/dist_test.sh configs/mot/tracktor/tracktor_faster-rcnn_r50_fpn_4e_mot17-public.py 8 --eval track
  1. Did you make any modifications on the code or config? Did you understand what you have modified?

Not at all.

  1. What dataset did you use and what task did you run?

Environment

sys.platform: linux
Python: 3.7.0 (default, Oct 9 2018, 10:31:47) [GCC 7.3.0]
CUDA available: True
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 10.2, V10.2.89
GPU 0,1,2,3,4,5,6,7: Quadro RTX 6000
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.7.1
PyTorch compiling details: PyTorch built with:

  • GCC 7.3
  • C++ Version: 201402
  • Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v1.6.0 (Git Hash 5ef631a030a6f73131c77892041042805a06064f)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • NNPACK is enabled
  • CPU capability usage: AVX2
  • CUDA Runtime 10.2
  • NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37
  • CuDNN 7.6.5
  • Magma 2.5.2
  • Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

TorchVision: 0.8.2
OpenCV: 4.5.1
MMCV: 1.2.4
mmtrack: 0.5.0

Error traceback
If applicable, paste the error trackback here.

Traceback (most recent call last):
  File "tools/test.py", line 171, in <module>
Traceback (most recent call last):
  File "tools/test.py", line 171, in <module>
    main()
  File "tools/test.py", line 151, in main
    args.gpu_collect)
  File "/home/miruware/projects/mmtracking/mmtrack/apis/test.py", line 82, in multi_gpu_test
    result = model(return_loss=False, rescale=True, **data)
  File "/home/miruware/anaconda3/envs/prj-vod-mmdet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    main()
  File "tools/test.py", line 151, in main
    args.gpu_collect)
  File "/home/miruware/projects/mmtracking/mmtrack/apis/test.py", line 82, in multi_gpu_test
    result = self.forward(*input, **kwargs)
  File "/home/miruware/anaconda3/envs/prj-vod-mmdet/lib/python3.7/site-packages/torch/nn/parallel/distributed.py", line 619, in forward
    result = model(return_loss=False, rescale=True, **data)    output = self.module(*inputs[0], **kwargs[0])

  File "/home/miruware/anaconda3/envs/prj-vod-mmdet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
  File "/home/miruware/anaconda3/envs/prj-vod-mmdet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/miruware/anaconda3/envs/prj-vod-mmdet/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 84, in new_func
        result = self.forward(*input, **kwargs)return old_func(*args, **kwargs)

  File "/home/miruware/projects/mmtracking/mmtrack/models/mot/base.py", line 154, in forward
  File "/home/miruware/anaconda3/envs/prj-vod-mmdet/lib/python3.7/site-packages/torch/nn/parallel/distributed.py", line 619, in forward
    return self.forward_test(img, img_metas, **kwargs)
  File "/home/miruware/projects/mmtracking/mmtrack/models/mot/base.py", line 131, in forward_test
    return self.simple_test(imgs[0], img_metas[0], **kwargs)
  File "/home/miruware/projects/mmtracking/mmtrack/models/mot/tracktor.py", line 119, in simple_test
    rescale=rescale)
      File "/home/miruware/projects/mmdetection/mmdet/models/roi_heads/test_mixins.py", line 113, in simple_test_bboxes
output = self.module(*inputs[0], **kwargs[0])
  File "/home/miruware/anaconda3/envs/prj-vod-mmdet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    rois = rois.reshape(batch_size, num_proposals_per_img, -1)
RuntimeError: cannot reshape tensor of 0 elements into shape [1, 0, -1] because the unspecified dimension size -1 can be any value and is ambiguous
    result = self.forward(*input, **kwargs)
  File "/home/miruware/anaconda3/envs/prj-vod-mmdet/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 84, in new_func
    return old_func(*args, **kwargs)
  File "/home/miruware/projects/mmtracking/mmtrack/models/mot/base.py", line 154, in forward
    return self.forward_test(img, img_metas, **kwargs)
  File "/home/miruware/projects/mmtracking/mmtrack/models/mot/base.py", line 131, in forward_test
    return self.simple_test(imgs[0], img_metas[0], **kwargs)
  File "/home/miruware/projects/mmtracking/mmtrack/models/mot/tracktor.py", line 119, in simple_test
    rescale=rescale)
  File "/home/miruware/projects/mmdetection/mmdet/models/roi_heads/test_mixins.py", line 113, in simple_test_bboxes
    rois = rois.reshape(batch_size, num_proposals_per_img, -1)
RuntimeError: cannot reshape tensor of 0 elements into shape [1, 0, -1] because the unspecified dimension size -1 can be any value and is ambiguous
@OceanPang
Copy link
Collaborator

Please do not use 8 GPUs.

There are only 7 videos in the MOT dataset.

@shwoo93
Copy link
Author

shwoo93 commented Apr 8, 2021

I have tried GPUs with 4, 5, 6, 7 instead, but all results in the same error above.
I think the error message indicates there are some empty rois.

cannot reshape tensor of 0 elements into shape [1, 0, -1] 

Any suggestions?

@OceanPang
Copy link
Collaborator

That's weird. Are you using the datasets we provided and directly run the commands? It seems that there are empty tensors that make the error. Which detector are you using?

@syo093c
Copy link

syo093c commented Apr 16, 2021

I have the same problem!
[RuntimeError: cannot reshape tensor of 0 elements into shape [1, 0, -1] because the unspecified dimension size -1 can be any value and is ambiguous]
I downgrade the mmdet from 2.11.0 to 2.9.0, and problem solved! Don't forget to install mmcv-full. I use version 1.2.7
I also found that mmdet in 2.11.0 is Incompatible when I want to train the model on my datasets.
Hope this might help you!

@OceanPang
Copy link
Collaborator

Hi all, this bug is caused by a feature update in MMDetection.
I have already fixed it in mmdetection, will be available in 2.12.0.

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

No branches or pull requests

3 participants