vita-epfl / openpifpaf

Official implementation of "OpenPifPaf: Composite Fields for Semantic Keypoint Detection and Spatio-Temporal Association" in PyTorch.
https://arxiv.org/abs/2103.02440
Other
81 stars 22 forks source link

indexerror while trainning on a subset of wholebody keypoints #10

Closed bungatlabs closed 1 year ago

bungatlabs commented 1 year ago

I am following instructions here to train on a subset of wholebody keypoints (excluding face and hand keypoints): https://openpifpaf.github.io/plugins_wholebody.html#using-only-a-subset-of-keypoints

I believe I have followed all the step: prepared train and eval annotation json files and commenting parts of constants.py

I realized that this constants.py will not be picked up when I run openpifpaf.train from the command line, so I created a short train.py file with this code:

##### train.py #####
import openpifpaf
import os

# this is the local constant.py where I have commented out unnecessary code
import constants

# here I am overriding constants in the package
openpifpaf.plugins.wholebody.constants = constants

# here I am calling openpifpaf.train as a shell command since I couldn't figure out how to call it within python directly
os.system('python -m openpifpaf.train --lr=0.0001 --momentum=0.95 --b-scale=3.0 --epochs=150 --lr-decay 130 140 --lr-decay-epochs=10 --batch-size=16 --weight-decay=1e-5 --dataset=wholebody --wholebody-upsample=2 --basenet=shufflenetv2k16 --loader-workers=16 --wholebody-train-annotations=./superform_wholebody_train.json --wholebody-val-annotations=./superform_wholebody_val.json --wholebody-train-image-dir=./train2017/ --wholebody-val-image-dir=./val2017/')

#################

I am getting this error: indexerror: boolean index did not match indexed array along dimension 0; dimension is 133 but corresponding boolean dimension is 23 Seems like it is picking up the original sized array from somewhere, but after hours of racking my brain I couldn't figure what's wrong. Is there a better way to do this?

There might be a bug somewhere and/or the documentation needs to be updated.

bungatlabs commented 1 year ago

Posted on the wrong repo. Sorry.