Having EXC_BAD_ACCESS in inferenceModule line 52 [Resolved]
simbertrand opened this issue · 2 comments
Hello there,
I just tested the ios_demo_app ObjectDetection project on XCode, with a custom model, and I noticed a weird bugg.
For the first image (the dog, with the bicycle and the truck), the inference worked. But with certain images (like the second one), it crashes with the error EXC_BAD_ACCESS. I also noticed that running twice the inference on the first image causes also the error (so I'm guessing this has something to do with some configuration). I've seen some people with similar issues in the release phase (people switched some configurations to be the same as in debug mode to solve it), but in my case it also happens on debug.
I was wondering if anyone had any idea of why I'm facing this issue, or if anyone had faced it.
I am using XCode.
Thank you
I found the problem. In the inference module, the output_size is calculated with 80 classes. We need to adjust like it is advised for the PrePostProcessor, in that file too. Anyone who took the time to analyse the code will see it easily, but I'm still writing this here if anyone like me isn't super experienced, and had just followed the steps in the guide. (maybe adding this modification in the READ.ME would be a good idea to save the persons with custom models some time).
@simbertrand Hello, I am facing a similar issue in the image segmentation demo:
Thread 1: EXC_BAD_ACCESS (code=1, address=0x10dd2c000)
It happened to the buffer
in
Do you have some suggestions on how to solve that issue? Do you suggest using the PyTorch Lite or the PyTorch Lite nightly since they are later versions? https://pytorch.org/mobile/ios/#using-the-nightly-pytorch-ios-libraries-in-cocoapods Thanks.