chenhang98 / BPR

code for `Look Closer to Segment Better: Boundary Patch Refinement for Instance Segmentation`
Apache License 2.0
173 stars 23 forks source link

Error during Inference (traceback : Signal 9 (SIGKILL)) #25

Closed eLeschke closed 2 years ago

eLeschke commented 2 years ago

Hello, When i try to run inference with the pre trained model, i get an error but i don't get the reason. The code runs on a colab notebook with 25GB RAM, could this be the problem? Thanks in advance!

command:

IOU_THRESH=0.25 \ IMG_DIR=/content/drive/MyDrive/datasets/coco/val2017 \ GT_JSON=/content/drive/MyDrive/datasets/coco/annotations/instances_val2017.json \ GPUS=1 \ sh tools/inference_coco.sh \ configs/bpr/hrnet18s_128.py \ /content/drive/MyDrive/BPR/hrnet18s_coco-c172955f.pth \ /content/drive/MyDrive/Bmask_coco_instances_json_results/coco_instances_results.json \ bmask_coco_instances_results_refined

return:

chenhang98 commented 2 years ago

It seems to be (CPU) memory overflow. Can you try to allocate a larger memory?

9

eLeschke commented 2 years ago

It seems to be (CPU) memory overflow. Can you try to allocate a larger memory? #9

Thank you for the answer, do you know how much memory i need at least?

chenhang98 commented 2 years ago

We tested these codes on a machine with 188G memory.

eLeschke commented 2 years ago

Is it possible to bypass the required RAM, maybe by saving the patches on the disk instead of RAM?

chenhang98 commented 2 years ago

I think so, but we don't have these codes. You can have a try.

eLeschke commented 2 years ago

i tried to run inference with a smaller sample of images now and i got the following error:

""" Traceback (most recent call last): File "/usr/lib/python3.7/multiprocessing/pool.py", line 121, in worker result = (True, func(*args, **kwds)) File "./tools/merge_patches.py", line 47, in run_inst newmask_refined[y:y+h, x:x+w] += patch_mask ValueError: operands could not be broadcast together with shapes (11,64) (64,64) (11,64) """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "./tools/merge_patches.py", line 111, in start() File "./tools/merge_patches.py", line 81, in start for r in p.imap_unordered(run_inst, enumerate(dt)): File "/usr/lib/python3.7/multiprocessing/pool.py", line 748, in next raise value ValueError: operands could not be broadcast together with shapes (11,64) (64,64) (11,64)

Can you help me with that? how is it possible that the shapes differ?

chenhang98 commented 2 years ago

You can check whether the index is out of bounds, e.g. y < 0 or y+h > the hight of image. It may be because the patch does not correspond to the image or the image size is smaller than 64x64.

eLeschke commented 2 years ago

Thank you very much!