RizwanMunawar / yolov7-pose-estimation

YOLOv7 Pose estimation using OpenCV, PyTorch
GNU General Public License v3.0
335 stars 77 forks source link

KeyError: 'nkpt' #1

Closed Deep-learning999 closed 1 year ago

Deep-learning999 commented 2 years ago

!python pose-estimate.py --source "football1.mp4" --device 0

Optimizer stripped from yolov7-w6-person.pt, 280.0MB Fusing layers... IDetect.fuse Frame 0 Processing

KeyError Traceback (most recent call last) Input In [7], in <cell line: 167>() 164 device='cpu' #'cpu/0,1,2,3(gpu)' 166 strip_optimizer(device,poseweights) --> 167 run(poseweights,source, device)

File E:\anaconda3\envs\sleap\lib\site-packages\torch\autograd\grad_mode.py:28, in _DecoratorContextManager.call..decorate_context(*args, kwargs) 25 @functools.wraps(func) 26 def decorate_context(*args, *kwargs): 27 with self.class(): ---> 28 return func(args, kwargs)

Input In [7], in run(poseweights, source, device) 94 output, _ = model(image) 96 #Apply non max suppression ---> 97 output = non_max_suppression_kpt(output, 0.25, 0.65, nc=model.yaml['nc'], nkpt=model.yaml['nkpt'], kpt_label=True) 98 output = output_to_keypoint(output) 99 im0 = image[0].permute(1, 2, 0) * 255

KeyError: 'nkpt'

RizwanMunawar commented 2 years ago

@Deep-learning999! It seems that you are using an anaconda environment. I have not tested the code with an anaconda environment. I would recommend using a virtual environment. The error is mainly related to Pytorch version conflict etc. BTW, Soon I will add the anaconda environment steps to run a code.