MVIG-SJTU / AlphaPose

Real-Time and Accurate Full-Body Multi-Person Pose Estimation&Tracking System
http://mvig.org/research/alphapose.html
Other
7.96k stars 1.97k forks source link

train error when evaluation #1015

Open lucasjinreal opened 2 years ago

lucasjinreal commented 2 years ago

train halpe26 always get some error:

alphapose/utils/metrics.py", line 110, in evaluate_mAP
    cocoEval.evaluate()
  File "/root/anaconda3/lib/python3.9/site-packages/pycocotools/cocoeval.py", line 157, in evaluate
    self.ious = {(imgId, catId): computeIoU(imgId, catId)
  File "/root/anaconda3/lib/python3.9/site-packages/pycocotools/cocoeval.py", line 157, in <dictcomp>
    self.ious = {(imgId, catId): computeIoU(imgId, catId)
  File "/root/anaconda3/lib/python3.9/site-packages/pycocotools/cocoeval.py", line 240, in computeOks
    dx = np.max((z, x0 - xd), axis=0) + np.max(
  File "<__array_function__ internals>", line 180, in amax
  File "/root/anaconda3/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 2791, in amax
    return _wrapreduction(a, np.maximum, 'max', axis, None, out,
  File "/root/anaconda3/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: operands could not be broadcast together with shapes (17,) (26,) 
Exception ignored in: <alphapose.utils.metrics.evaluate_mAP.<locals>.NullWriter object at 0x7f8dc3d60c10>
AttributeError: 'NullWriter' object has no attribute 'flush'

how to avoid this error??

HaoyiZhu commented 2 years ago

Hi, this is because pycocotools is for 17 keypoints while Halpe26 has 26 keypoints. If you want to validate Halpe26 by yourself, maybe you can manually modify the sigmas variable in function computeOks in file cocoeval.py in {your_env_path}/site-packages/pycocotools/cocoeval.py. You should make the sigmas to have 26 values. You can refer to here