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

AssertionError: Top-down heatmap only supports single instance. Got invalid shape of bbox_center (0,). #2860

Open
3 tasks done
followingcode opened this issue Jul 15, 2024 · 1 comment
Assignees

Comments

@followingcode
Copy link

Branch

main branch (1.x version, such as v1.0.0, or dev-1.x branch)

Prerequisite

Environment

sys.platform: linux
Python: 3.8.19 (default, Mar 20 2024, 19:58:24) [GCC 11.2.0]
CUDA available: True
MUSA available: False
numpy_random_seed: 2147483648
GPU 0: NVIDIA GeForce RTX 3060
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 11.3, V11.3.109
GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
PyTorch: 1.10.1
PyTorch compiling details: PyTorch built with:

  • GCC 7.3
  • C++ Version: 201402
  • Intel(R) oneAPI Math Kernel Library Version 2023.1-Product Build 20230303 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: AVX2
  • CUDA Runtime 11.3
  • 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_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_37,code=compute_37
  • CuDNN 8.2
  • Magma 2.5.2
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.2.0, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -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, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.10.1, USE_CUDA=ON, USE_CUDNN=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.11.2
OpenCV: 4.10.0
MMEngine: 0.10.4
MMAction2: 1.2.0+4d6c934
MMCV: 2.1.0
MMDetection: 3.3.0
MMPose: 1.3.1

Describe the bug

Loads checkpoint by http backend from path: https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco-person/faster_rcnn_r50_fpn_1x_coco-person_20201216_175929-d022e227.pth
Performing Human Detection for each frame
[ ] 0/64, elapsed: 0s, ETA:07/15 09:51:13 - mmengine - WARNING - "FileClient" will be deprecated in future. Please use io functions in https://mmengine.readthedocs.io/en/latest/api/fileio.html#file-io
07/15 09:51:13 - mmengine - WARNING - "HardDiskBackend" is the alias of "LocalBackend" and the former will be deprecated in future.
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 64/64, 9.1 task/s, elapsed: 7s, ETA: 0s

Hard 1-person Example, found 1 tracklet
Loads checkpoint by http backend from path: https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w32_coco_256x192-c78dce93_20200708.pth
/root/mmpose/mmpose/apis/inference.py:121: UserWarning: Can not load dataset_meta from the checkpoint or the model config. Use COCO metainfo by default.
warnings.warn('Can not load dataset_meta from the checkpoint or the '
/root/mmpose/mmpose/datasets/datasets/utils.py:102: UserWarning: The metainfo config file "configs/base/datasets/coco.py" does not exist. A matched config file "/root/mmpose/mmpose/.mim/configs/base/datasets/coco.py" will be used instead.
warnings.warn(
Performing Human Pose Estimation for each frame
[ ] 0/64, elapsed: 0s, ETA:Traceback (most recent call last):
File "tools/data/skeleton/ntu_pose_extraction.py", line 304, in
anno = ntu_pose_extraction(args.video, args.skip_postproc)
File "tools/data/skeleton/ntu_pose_extraction.py", line 273, in ntu_pose_extraction
keypoints, scores = pose_inference_with_align(args, frame_paths,
File "tools/data/skeleton/ntu_pose_extraction.py", line 238, in pose_inference_with_align
pose_results, _ = pose_inference(args.pose_config, args.pose_checkpoint,
File "/root/mmaction2/mmaction/apis/inference.py", line 277, in pose_inference
= inference_topdown(model, f, d[..., :4], bbox_format='xyxy')
File "/root/mmpose/mmpose/apis/inference.py", line 188, in inference_topdown
data_list.append(pipeline(data_info))
File "/root/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 60, in call
data = t(data)
File "/root/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmcv/transforms/base.py", line 12, in call
return self.transform(results)
File "/root/mmpose/mmpose/datasets/transforms/topdown_transforms.py", line 93, in transform
assert results['bbox_center'].shape[0] == 1, (
AssertionError: Top-down heatmap only supports single instance. Got invalid shape of bbox_center (0,).
/root/miniconda3/envs/openmmlab/lib/python3.8/tempfile.py:827: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/tmpdmhfux7i'>
_warnings.warn(warn_message, ResourceWarning)

Reproduces the problem - code sample

No response

Reproduces the problem - command or script

python tools/data/skeleton/ntu_pose_extraction.py tools/data/skeleton/S001C001P008R002A043_rgb.avi tools/data/skeleton/S001C001P008R002A043.pkl

Reproduces the problem - error message

Loads checkpoint by http backend from path: https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco-person/faster_rcnn_r50_fpn_1x_coco-person_20201216_175929-d022e227.pth
Performing Human Detection for each frame
[ ] 0/64, elapsed: 0s, ETA:07/15 09:51:13 - mmengine - WARNING - "FileClient" will be deprecated in future. Please use io functions in https://mmengine.readthedocs.io/en/latest/api/fileio.html#file-io
07/15 09:51:13 - mmengine - WARNING - "HardDiskBackend" is the alias of "LocalBackend" and the former will be deprecated in future.
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 64/64, 9.1 task/s, elapsed: 7s, ETA: 0s

Hard 1-person Example, found 1 tracklet
Loads checkpoint by http backend from path: https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w32_coco_256x192-c78dce93_20200708.pth
/root/mmpose/mmpose/apis/inference.py:121: UserWarning: Can not load dataset_meta from the checkpoint or the model config. Use COCO metainfo by default.
warnings.warn('Can not load dataset_meta from the checkpoint or the '
/root/mmpose/mmpose/datasets/datasets/utils.py:102: UserWarning: The metainfo config file "configs/base/datasets/coco.py" does not exist. A matched config file "/root/mmpose/mmpose/.mim/configs/base/datasets/coco.py" will be used instead.
warnings.warn(
Performing Human Pose Estimation for each frame
[ ] 0/64, elapsed: 0s, ETA:Traceback (most recent call last):
File "tools/data/skeleton/ntu_pose_extraction.py", line 304, in
anno = ntu_pose_extraction(args.video, args.skip_postproc)
File "tools/data/skeleton/ntu_pose_extraction.py", line 273, in ntu_pose_extraction
keypoints, scores = pose_inference_with_align(args, frame_paths,
File "tools/data/skeleton/ntu_pose_extraction.py", line 238, in pose_inference_with_align
pose_results, _ = pose_inference(args.pose_config, args.pose_checkpoint,
File "/root/mmaction2/mmaction/apis/inference.py", line 277, in pose_inference
= inference_topdown(model, f, d[..., :4], bbox_format='xyxy')
File "/root/mmpose/mmpose/apis/inference.py", line 188, in inference_topdown
data_list.append(pipeline(data_info))
File "/root/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 60, in call
data = t(data)
File "/root/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmcv/transforms/base.py", line 12, in call
return self.transform(results)
File "/root/mmpose/mmpose/datasets/transforms/topdown_transforms.py", line 93, in transform
assert results['bbox_center'].shape[0] == 1, (
AssertionError: Top-down heatmap only supports single instance. Got invalid shape of bbox_center (0,).
/root/miniconda3/envs/openmmlab/lib/python3.8/tempfile.py:827: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/tmpdmhfux7i'>
_warnings.warn(warn_message, ResourceWarning)

Additional information

Want to know the cause of the error and how to fix it
NTU RGB+D dataset

@followingcode
Copy link
Author

tools/data/skeleton/ntu_pose_extraction.py
Line 216 needs to be changed to
return np.stack([det_results], axis=1)

After the change, there will be no mistakes

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

2 participants