Closed Shivankit99 closed 4 years ago
I was having trouble with Segmentation Fault errors too. I managed to solve it by using another NNPACK repo, https://github.com/shizukachan/NNPACK.
@angmorpri ive tried that repository. It seems to be a problem with NNPACK. Did you install NNPACK using cmake or confu ?
I used the cmake
option, with confu
I didn't even managed to build it.
Precisely, what I do is:
cd NNPACK
mkdir build && cd build
cmake -G Ninja -D BUILD_SHARED_LIBS=ON ..
ninja
sudo ninja install
My build with Ninja always fails saying : ninja: build stopped: subcommand failed. ive added ninja to the path variables as well. Any ideas on how to work around this ?
My builds are successful with ninja now. But still the segmentation fault persists. i ran it under gdb:
0xb6f35dd4 in compute_gemm_convolution_inference.isra () from /usr/local/lib/libnnpack.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb)
This is what i got .. Any ideas on how to debug this ? any help would be greatly appreciated. Ive tried the solutions in the NNPACK repository as well
@angmorpri Ive got a raspberry pi 3b+ and a raspberry pi 4b as well. Both give me the exact same issue.
May I see which command are you using or what are you trying to run?
git clone https://github.com/Maratyszcza/NNPACK cd NNPACK mkdir build cd build cmake -G Ninja -DBUILD_SHARED_LIBS=on-DCMAKE_C_FLAGS=-march=armv6k .. ninja sudo ninja install git clone https://github.com/shizukachan/darknet-nnpack.git cd darknet-nnpack make wget https://pjreddie.com/media/files/yolov3-tiny.weights ./darknet detector test cfg/coco.data cfg/yolov3-tiny.cfg yolov3-tiny.weights data/dog.jpg
please let me know if you need additional information
im able to use the darknet-nnpack repository without NNPACK. But the model is just not fast enough then.
Try using this repo for NNPACK instead of Maratyszcza. You can follow the same building steps.
@angmorpri Thank you so much for the help. it works now. Although predictions are taking longer than what the results are shown in the repository. For eg. the pretrained yolov3-tiny took 2.9 seconds. Any ideas why this is happening ? opencv NNPACK NNPACK_FAST ARM_NEON and OPENMP all are = 1
That is something I have not figured out yet. It happens to me too. In fact, I'm surprised it only takes you 2.9 seconds; mine uses literally the same repositories and takes around 4 seconds on average.
im testing on a raspberry pi 4b maybe thats the difference. Although have you tried with other repositories for darknet-nnpack? Also the results for the pretrained yolo model with 80 classes and a custom trained model with just two classes is the same 2.9 seconds. I was able to get better results on two classes without NNPACK.
@angmorpri its probably because of the values of height and width in the cfg file. Try reducing it 256. It reduces the time by 1 second but it does reduce the confidence scores as well. Although still cant match the results in the readme files
Actually, for my purposes I don't really need to lower the inference time, but thanks for the recommendation! Anyway, as the original problem seems to be solved I think we should close this issue.
Thanks for the help
cmake -G Ninja -DBUILD_SHARED_LIBS=on-DCMAKE_C_FLAGS=-march=armv6k ..
Hi, i tried to run this command cmake -G Ninja -DBUILD_SHARED_LIBS=on-DCMAKE_C_FLAGS=-march=armv6k .. but the process always stuck at [37/123] Building CXX object CMakeFiles.../test/convolutional-outpu/alexnet.cc.o did you get the same problem? could you tell me how to fix it?
tiny yolov3 always gives segmentation fault after loading the entire network and loading the weights. Im doing it on a raspberry pi3b+ and doing using the network to detect on 2 classes. using batch=1 and subdivisions=1. Can anyone help ?