open-mmlab / mmpose

OpenMMLab Pose Estimation Toolbox and Benchmark.
https://mmpose.readthedocs.io/en/latest/
Apache License 2.0
5.65k stars 1.22k forks source link

ValueError: LinearReIDHead: Please choose at least one loss in triplet loss and cross entropy loss. #888

Closed Rakin96 closed 3 years ago

Rakin96 commented 3 years ago

Checklist

Describe the bug

While trying to run the "demo/top_down_pose_tracking_demo_with_mmtracking.py" i get the error in the title: ValueError: LinearReIDHead: Please choose at least one loss in triplet loss and cross entropy loss. or ValueError: Tracktor: BaseReID: LinearReIDHead: Please choose at least one loss in triplet loss and cross entropy loss. I have been successful to run all the other top-down demo. just stuck in this one with mmtracking.

Reproduction

python -m demo.top_down_pose_tracking_demo_with_mmtracking demo/mmtracking_cfg/tracktor_faster-rcnn_r50_fpn_4e_mot17-private.py configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/hrnet_w48_coco_256x192.py https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth --video-path demo/resources/demo.mp4 --out-video-root vis_results --show
demo/mmtracking_cfg/tracktor_faster-rcnn_r50_fpn_4e_mot17-private.py
configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/hrnet_w48_coco_256x192.py

Environment

  1. Please run PYTHONPATH=${PWD}:$PYTHONPATH python mmpose/utils/collect_env.py to collect necessary environment information and paste it here.
    
    Python: 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
    CUDA available: True
    GPU 0: GeForce GTX 1080
    CUDA_HOME: /usr/local/cuda-10.0
    NVCC: Cuda compilation tools, release 10.0, V10.0.130
    GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
    PyTorch: 1.4.0+cu100
    PyTorch compiling details: PyTorch built with:
    - GCC 7.3
    - Intel(R) Math Kernel Library Version 2019.0.4 Product Build 20190411 for Intel(R) 64 architecture applications
    - Intel(R) MKL-DNN v0.21.1 (Git Hash 7d2fd500bc78936d1d648ca713b901012f470dbc)
    - OpenMP 201511 (a.k.a. OpenMP 4.5)
    - NNPACK is enabled
    - CUDA Runtime 10.0
    - 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.3
    - Magma 2.5.1
    - Build settings: BLAS=MKL, BUILD_NAMEDTENSOR=OFF, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -O2 -fPIC -Wno-narrowing -Wall -Wextra -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-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -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 -Wno-stringop-overflow, DISABLE_NUMA=1, 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, USE_STATIC_DISPATCH=OFF, 

TorchVision: 0.5.0+cu100 OpenCV: 4.5.3 MMCV: 1.3.12 MMCV Compiler: GCC 7.5 MMCV CUDA Compiler: 10.0 MMPose: 0.17.0+e336702

1. You may add addition that may be helpful for locating the problem, such as
  - How you installed PyTorch [e.g., pip, conda, source]
  - Other environment variables that may be related (such as `$PATH`, `$LD_LIBRARY_PATH`, `$PYTHONPATH`, etc.)

**Error traceback**

If applicable, paste the error traceback here.

/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmdet/core/anchor/builder.py:17: UserWarning: build_anchor_generator would be deprecated soon, please use build_prior_generator 'build_anchor_generator would be deprecated soon, please use ' Traceback (most recent call last): File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcv/utils/registry.py", line 52, in build_from_cfg return obj_cls(**args) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmtrack/models/reid/linear_reid_head.py", line 58, in init raise ValueError('Please choose at least one loss in ' ValueError: Please choose at least one loss in triplet loss and cross entropy loss.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcv/utils/registry.py", line 52, in build_from_cfg return obj_cls(args) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmtrack/models/reid/base_reid.py", line 11, in init super().init(*args, *kwargs) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcls/models/classifiers/image.py", line 25, in init self.head = build_head(head) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcls/models/builder.py", line 25, in build_head return HEADS.build(cfg) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcv/utils/registry.py", line 212, in build return self.build_func(args, kwargs, registry=self) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcv/utils/registry.py", line 55, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') ValueError: LinearReIDHead: Please choose at least one loss in triplet loss and cross entropy loss.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcv/utils/registry.py", line 52, in build_from_cfg return obj_cls(*args) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmtrack/models/mot/tracktor.py", line 28, in init self.reid = build_reid(reid) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmtrack/models/builder.py", line 23, in build_reid return REID.build(cfg) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcv/utils/registry.py", line 212, in build return self.build_func(args, **kwargs, registry=self) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcv/utils/registry.py", line 55, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') ValueError: BaseReID: LinearReIDHead: Please choose at least one loss in triplet loss and cross entropy loss.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/user/mmpose/mmpose/demo/top_down_pose_tracking_demo_with_mmtracking.py", line 165, in main() File "/home/user/mmpose/mmpose/demo/top_down_pose_tracking_demo_with_mmtracking.py", line 81, in main args.tracking_config, None, device=args.device.lower()) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmtrack/apis/inference.py", line 34, in init_model model = build_model(config.model) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmtrack/models/builder.py", line 34, in build_model return MODELS.build(cfg) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcv/utils/registry.py", line 212, in build return self.build_func(*args, **kwargs, registry=self) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "/home/user/mmpose/mmpose/env/lib/python3.6/site-packages/mmcv/utils/registry.py", line 55, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') ValueError: Tracktor: BaseReID: LinearReIDHead: Please choose at least one loss in triplet loss and cross entropy loss.

ly015 commented 3 years ago

Could you please provide the version information of mmtracking you used?

Rakin96 commented 3 years ago

mmtrack==0.6.0

ly015 commented 3 years ago

This issue is caused by out-of-date mmtrack config used in the demo. It will be fixed by #891