EverybodyDanceNow_reproduce_pytorch icon indicating copy to clipboard operation
EverybodyDanceNow_reproduce_pytorch copied to clipboard

ValueError: zero-size array to reduction operation minimum which has no identity

Open lampsonSong opened this issue 6 years ago • 2 comments

Hello,

I met the title problem in step 2 make_target.py, the 1918 image. I think the reason is pytorch version. I use pytorch 1.0.0. In line 98&99 of make_target.py

img[int(head_cord[1] - crop_size): int(head_cord[1] + crop_size), int(head_cord[0] - crop_size): int(head_cord[0] + crop_size), :]

the start index might be negative when the person is on the edge of images. So I add a constraint on it :

head = img[max(0, int(head_cord[1] - crop_size)): int(head_cord[1] + crop_size), max(0, int(head_cord[0] - crop_size)): int(head_cord[0] + crop_size), :]

This would guarantee the index at least be 0.

lampsonSong avatar Jan 25 '19 08:01 lampsonSong

Thank you very much for your advice. If you find any further problems in the future, you can let me know at any time. :)

yanx27 avatar Jan 25 '19 11:01 yanx27

Hello,

I met the title problem in step 2 make_target.py, the 1918 image. I think the reason is pytorch version. I use pytorch 1.0.0. In line 98&99 of make_target.py

img[int(head_cord[1] - crop_size): int(head_cord[1] + crop_size), int(head_cord[0] - crop_size): int(head_cord[0] + crop_size), :]

the start index might be negative when the person is on the edge of images. So I add a constraint on it :

head = img[max(0, int(head_cord[1] - crop_size)): int(head_cord[1] + crop_size), max(0, int(head_cord[0] - crop_size)): int(head_cord[0] + crop_size), :]

This would guarantee the index at least be 0.

Thank you very much!

Suasy avatar Apr 17 '21 14:04 Suasy