stefanopini / simple-HRNet

Multi-person Human Pose Estimation with HRNet in Pytorch
GNU General Public License v3.0
579 stars 108 forks source link

A small Bug #62

Closed aakashcurefit closed 4 years ago

aakashcurefit commented 4 years ago

Hi,

Here -> https://github.com/stefanopini/simple-HRNet/blob/master/misc/utils.py#L243

This should be -- avg_acc = avg_acc / cnt if cnt != 0 else torch.tensor(0)

and in similar places.

Else, you will get an Attribute error as avg_acc.item() doesn't have an attribute .item() whenever this is function returns 0.

Thanks!!

stefanopini commented 4 years ago

Thank you for catching it! I've just fixed that in the latest commit.

I didn't find similar issues in the rest of the code, but please let me know if you find them.