You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks a lot for sharing your code. I am sharing with you how I managed to fix two errors when running your code. Maybe it can help who face the same problems. For some reason, just two images in my dataset generated these errors, on file mtcnn_detector.py:
error 1)
could not broadcast input array from shape (0,63,3) into shape (58,63,3), where "63" can be any other value...
error 2)
tmp = np.zeros((tmph[i], tmpw[i], 3), dtype=np.uint8)
ValueError: negative dimensions are not allowed.
The two new conditions below fixed (temporary, as I didn't track the source of it) the problem:
(line 280)
# pad the bbox
[dy, edy, dx, edx, y, ey, x, ex, tmpw, tmph] = self.pad(total_boxes, width, height)
# (3, 24, 24) is the input shape for RNet
input_buf = np.zeros((num_box, 3, 24, 24), dtype=np.float32)
What an amazing! I had met almost the same bug with you. And after debugging, I found the original source code is wrong. But my bug is a little different from yours. Your condition shows the edy[i] may be negative.
could not broadcast input array from shape (0,63,3) into shape (58,63,3)
but my bug remind us the edx[i] may also be negative.
could not broadcast input array from shape (65,0,3) into shape (65,51,3)
So I used your bug fixed method and added another judge condition at the same time. My bug is fixed :-)
What an amazing! I had met almost the same bug with you. And after debugging, I found the original source code is wrong. But my bug is a little different from yours. Your condition shows the edy[i] may be negative.
could not broadcast input array from shape (0,63,3) into shape (58,63,3)
but my bug remind us the edx[i] may also be negative.
could not broadcast input array from shape (65,0,3) into shape (65,51,3)
So I used your bug fixed method and added another judge condition at the same time. My bug is fixed :-)
Thanks a lot for sharing your code. I am sharing with you how I managed to fix two errors when running your code. Maybe it can help who face the same problems. For some reason, just two images in my dataset generated these errors, on file mtcnn_detector.py:
error 1)
could not broadcast input array from shape (0,63,3) into shape (58,63,3), where "63" can be any other value...
error 2)
tmp = np.zeros((tmph[i], tmpw[i], 3), dtype=np.uint8)
ValueError: negative dimensions are not allowed.
The two new conditions below fixed (temporary, as I didn't track the source of it) the problem:
(line 280)
# pad the bbox
[dy, edy, dx, edx, y, ey, x, ex, tmpw, tmph] = self.pad(total_boxes, width, height)
# (3, 24, 24) is the input shape for RNet
input_buf = np.zeros((num_box, 3, 24, 24), dtype=np.float32)
The text was updated successfully, but these errors were encountered: