zhou13 / lcnn

LCNN: End-to-End Wireframe Parsing
MIT License
506 stars 94 forks source link

Segmentation fault #69

Closed yannick-reich closed 1 year ago

yannick-reich commented 1 year ago

Dear maintainers,

when trying to detect a wireframe on my own images (I'm using an image from the training data as "my image" to make sure the image is not the problem) I get a segmentation fault. Where could you imagine the cause of this to be?

Thanks for your help! Regards, Yannick

Some basic info about my system:

zhou13 commented 1 year ago

Could you trace the segmentation fault to the python function? If you follow exactly the instruction without any change (which should have been done by many people successfully, but might still generate segfault due to version or environments), are you able to run the evaluation?

yannick-reich commented 1 year ago

On a side note, when trying to run the validation I first encountered a different problem: process.py was trying to deserialize the checkpoint on a CUDA device. But I don't have one. As far as I could tell that was because in line 77 of process.py the map_location argument in torch.load wasn't set. And because the checkpoint probably contains GPU tensors, torch will automatically try to load to the GPU. I thus changed line 77 to checkpoint = torch.load(args["<checkpoint>"], map_location=device).

Now, when I run process.py on the validation set, as described in "Testing Pretrained Models", I run into what seems to be the same problem as when trying to get a wireframe with demo.py: In the forward pass H = model(input_dict)["preds"], that's line 102 in process.py and line 112 in demo.py, the segmentation fault occurs.

Now frankly this does look like it's not a problem with your code, but with my system or pytorch. But unfortunately I wasn't able to derive any meaningful information from what happens in torch at that point. Do you perhaps have an idea of where I could search?

zhou13 commented 1 year ago

You can use pdb to do the debugging inside the model and see where it crashes.

zhou13 commented 1 year ago

I will close this issue and feel free to reopen it if you have new findings.