Closed enfild closed 2 years ago
Hi @enfild are using edgetpu_runtime 14 version?
Can you try with any other models and let us know if it's happening with other models too. Thanks!
Hi @hjonnala i build edgetpu from source (just git clone ...
and make
). But I will try to do as you said (install edgetpu_runtime from url).
I think your suggestion for using a different model is good. Can you advise me Object detection model from open sources for coral?
Thank you
I think, it is okay if you build the library using libedgetpu repo. Just want to make sure, if you are using latest runtime or not.
Here are some object detection models: https://coral.ai/models/object-detection/ You can get all those models from test_data repo.
@hjonnala Thank you for help, this issue based on uncorrect model, because models from test_repo by coral, work is good. i close issue
Hi @hjonnala . Unfortunately I was happy early, because I checked the models from the test data only for classification. But when I take models(from test data) to object detection, the problem comes back again. I use edgetpu_runtime 14. May by you has any idea?
Hi @emfid can you please share the files and steps needed to reproduce the issue.
@hjonnala it is module for main programm Files: https://drive.google.com/drive/folders/1WPE7orTM55xZe7Hkz5r4z7xYrZ5oHSF3?usp=sharing
Thanks for sharing the files. I am trying to build the code with cmake but i am getting the following error. Can you lease share the steps how to build and run the code. Also, please share the model that you are trying to run. Thanks!
@hjonnala I wrote the required minimal example, to use it you need to run the build from the test folder(with model and image). https://drive.google.com/drive/folders/1jvRUpYHemYuGA56wWdccy4Jsc8v-0biv?usp=sharing Please install Qt(100 Mb):
sudo apt install qt5-default
I tested this on PC and RPi, I meet segmentation fault everywhere
I am having issues with qt installation on linux. But I am able to run benchmarks using libcoral and object detection using PyCoral API. Looks like the model is not detecting the objects accurately. Have you tested the accuracy with CPU tflite model? can you you please try your scripts with this model and let me know if you are facing any issues?
hemanth@hemanth-glaptop:~/coral/pycoral$ python3 examples/detect_image.py --model ../../Downloads/NNcontroller-20211214T134511Z-001/NNcontroller/test/detect_edgetpu.tflite --labels test_data/coco_labels.txt --input test_data/grace_hopper.bmp --output ${HOME}/grace_hopper_processed.bmp -c 5
----INFERENCE TIME----
Note: The first inference is slow because it includes loading the model into Edge TPU memory.
25.41 ms
14.82 ms
14.64 ms
14.83 ms
15.19 ms
-------RESULTS--------
bicycle
id: 1
score: 0.5703125
bbox: BBox(xmin=-27, ymin=87, xmax=468, ymax=623)
person
id: 0
score: 0.4296875
bbox: BBox(xmin=316, ymin=478, xmax=463, ymax=540)
hemanthj@hemanth-glaptop:~/libcoral/out/k8/benchmarks/coral$ ./single_model_benchmark -model ../../../../..//Downloads/NNcontroller-20211214T134511Z-001/NNcontroller/test/detect_edgetpu.tflite
2021-12-14 14:14:17
Running ./single_model_benchmark
Run on (4 X 3900 MHz CPU s)
CPU Caches:
L1 Data 32K (x2)
L1 Instruction 32K (x2)
L2 Unified 256K (x2)
L3 Unified 4096K (x1)
Load Average: 3.91, 4.35, 3.56
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
-----------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------
BM_Model 14.8 ms 2.31 ms 290 detect_edgetpu.tflite
@hjonnala Thanks for the model reference. I tested it and got the same error. My model may be inaccurate and bad-quality, but it doesn't matter for me. For me the most important thing is understanding why I get segmentation error when embedding Coral with TF lite in my projects with test or my models. I removed Qt from minimal example, but the error still occurs: https://drive.google.com/drive/folders/1sdBT6NsJnocuPagVFxDLuaPm7cGcT2yk?usp=sharing I checked that all the code examples from Coral repository work great. I think this is due to the fact that images are processed without delays and continuously. In my example I have discontinuous processing. What are you think? Is this the reason of failure? Thanks again!
Hi @hjonnala . I'm sorry, I just noticed that the access was not open. Corrected.
Valgrind output is Conditional jump or move depends on uninitialised value(s)
valgrind ./SkyDanceServer==29672== Memcheck, a memory error detector
==29672== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==29672== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==29672== Command: ./SkyDanceServer
==29672==
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
--29672-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13
Loading config: config.json
FrameReceiverController
FrameReceiverControllerPrivate
USB or CSI camera
[ WARN:0] global /home/pavel/Downloads/opencv-4.5.1/modules/videoio/src/cap_gstreamer.cpp (961) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
start ControllerNeuroNetworks
start ControllerNeuroNetworksPrivate
Checking readiness of Coral device
EDGE TPU path: /sys/bus/usb/devices/2-1
cv mat size: 640 480
Coral is ready!
Invoke is done!
time: 55.3672
cv mat size: 640 480
Coral is ready!
Invoke is done!
time: 159.751
Mon Dec 20 15:08:33 2021: CNN is ready, example frame was processed
SaveFrameClass
cv mat size: 640 480
Coral is ready!
==29672== Thread 7 FrameReceiverCon:
==29672== Conditional jump or move depends on uninitialised value(s)
==29672== at 0x67E66C: tflite::ops::custom::detection_postprocess::ValidateBoxes(TfLiteTensor const*, int) (in /home/pavel/visinav-rnd/build/SkyDanceServer/SkyDanceServer)
==29672== by 0x68006E: tflite::ops::custom::detection_postprocess::NonMaxSuppressionSingleClassHelper(TfLiteContext*, TfLiteNode*, tflite::ops::custom::detection_postprocess::OpData*, std::vector<float, std::allocator<float> > const&, std::vector<int, std::allocator<int> >*, int) (in /home/pavel/visinav-rnd/build/SkyDanceServer/SkyDanceServer)
==29672== by 0x681143: tflite::ops::custom::detection_postprocess::NonMaxSuppressionMultiClassFastHelper(TfLiteContext*, TfLiteNode*, tflite::ops::custom::detection_postprocess::OpData*, float const*) (in /home/pavel/visinav-rnd/build/SkyDanceServer/SkyDanceServer)
==29672== by 0x68169A: tflite::ops::custom::detection_postprocess::NonMaxSuppressionMultiClass(TfLiteContext*, TfLiteNode*, tflite::ops::custom::detection_postprocess::OpData*) (in /home/pavel/visinav-rnd/build/SkyDanceServer/SkyDanceServer)
==29672== by 0x56F056: tflite::Subgraph::Invoke() (in /home/pavel/visinav-rnd/build/SkyDanceServer/SkyDanceServer)
==29672== by 0x49E092: tflite::Interpreter::Invoke() (in /home/pavel/visinav-rnd/build/SkyDanceServer/SkyDanceServer)
@enfild Did you try to build the libedgetpu with debug/detailed logging enabled? We can get some hints from there. I would suggest you to change the log_level of libedgetpu at https://github.com/google-coral/libedgetpu/blob/master/port/default/port_from_tf/logging.cc#L171 and then rebuild this library by following the instructions given at https://github.com/google-coral/libedgetpu#building.
You can set the log_level value from 1 to 10 (10 being the most detailed) to get the detailed output of libedgetpu and then we can probably understand where exactly it is failing.
Alternatively, you can call this API :
https://coral.ai/docs/reference/cpp/edgetpu/#_CPPv4N7edgetpu14EdgeTpuManager12SetVerbosityEi to increase the verbosity.
@manoj7410 thanks for you recommendations! Now i get this output:
I see that you have already used GDB. Did you try to run the bt command? Also, can you try to run gdb ./[Executable] core
@manoj7410 , yes i get bt
out like this:
gdb ./[Executable] core
not gave nothing new
I managed to solve the problem. using a shared pointer to the interpreter and passing the pointer to the invoke execution area.
Description
System information
Description When i calls
initTfLiteInterpreter()
, tfLite work is correct, output has all information (boxes, labels and classes), time of invoke is good (15 ms). But when i callsprocessingFrame(cv::Mat)
in other classes with equalent code (i get Seg fault onInterpreter->invoke()
):I get this error with TF 2.5.0, 2.6.0.
Source of my programm TestClass.h:
TestClass.cxx:
Click to expand!
### Issue Type Bug ### Operating System Ubuntu ### Coral Device USB Accelerator ### Other Devices _No response_ ### Programming Language C++ ### Relevant Log Output ```shell **LOGS** Checking readiness of Coral device EDGE TPU path: /sys/bus/usb/devices/2-1 cv mat size: 640 480 Invoke is done! 1 score:0.902344 time: 0.022215 cv mat size: 640 480 Invoke is done! 1 score:0.902344 time: 0.012465 cv mat size: 640 480 Invoke is done! 1 score:0.902344 time: 0.011841 cv mat size: 640 480 Invoke is done! 1 score:0.902344 time: 0.011659 cv mat size: 640 480 Invoke is done! 1 score:0.902344 time: 0.014413 cv mat size: 640 480 Invoke is done! 1 score:0.902344 time: 0.011502 cv mat size: 640 480 Invoke is done! 1 score:0.902344 time: 0.012496 cv mat size: 640 480 Invoke is done! 1 score:0.902344 time: 0.012136 cv mat size: 640 480 Invoke is done! 1 score:0.902344 time: 0.012898 cv mat size: 640 480 Invoke is done! 1 score:0.902344 time: 0.012129 Thu Dec 9 11:52:59 2021: CNN is ready, example frame was processed cv mat size: 640 480 Segmentation fault (core dumped) **GDB out** 0x000000000067d47c in tflite::ops::custom::detection_postprocess::DecodeCenterSizeBoxes(TfLiteContext*, TfLiteNode*, tflite::ops::custom::detection_postprocess::OpData*) ``` ```