0531 Final struggle ends with legendary segfault

Deploy the trained defect detection model

  • Linux Ubuntu18.04 dual-machine attempt to
    insert image description here
    report an error, the Linux kernel or compiler version does not match, tried to change the gcc, g++, gcc-arm-linux, g+±arm-linux code of 18.04 many times, tried to change the compilation in the Makefile file The device path and adding the LInux kernel header files failed to do so. As for the environment configuration of the development board, because the library is too low-level, it is likely to affect the system, so the environment configuration cannot be modified.
root@awcloud:/opt/paddle_frame# cd /opt/paddle_frame
root@awcloud:/opt/paddle_frame# chmod 777 ./run.sh
root@awcloud:/opt/paddle_frame# ./run.sh
insmod: ERROR: could not insert module cmadrv.ko: File exists
./ssd_detection: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.27' not found (required by ./paddlelite_lib/libpaddle_full_api_shared.so)

Check the relevant supported version and find that the version is too high to be supported:

root@awcloud:/opt/paddle_frame# strings  /lib/arm-linux-gnueabihf/libm.so.6 |grep GLIBC_
GLIBC_2.4
GLIBC_2.15
GLIBC_2.18
GLIBC_2.23
GLIBC_PRIVATE
  • The CentOS virtual machine (on the Baoqi notebook, still with two computers)
    insert image description here
    was successfully deployed. Detection picture:
    insert image description here
    detection effect:
    insert image description here

Change ssd_dection.cc source code and recompile

  • Error:
    The compiler path in CMakeLisrs.txt is changed to an absolute path

Real-time prediction of camera shooting data

  • The PL end stores the data in DDR3, and passes the start address of the stored data to sse_detection.cc as a parameter, and the PS end reads the stored data on the DDR3 and converts it into the OpenCV format for detection.
  • Write the script my_run.sh to facilitate debugging and running code. /opt/my_run.sh will automatically set the path, change file permissions, and execute the program.
  • Encountered a problem, the opt tool used by the nb file is inconsistent with the Paddle-Lite version. Change the path in some places to absolute path, no warning.
  • Unresolved issues: Steps to load model, segfault, cause unknown.
    insert image description here

Document description

  • The detection-related source code is in /opt/nna of the notebook virtual machine, and the source code is always called in the main.c in the desktop C5TB folder
  • If you want to run the program, the desktop desktop ubuntu and CentOS7 are compiled. If ubuntu reports an error, see Linux Ubuntu18.04 dual-machine try. In CentOS7, the suffix 0 is the second demo that can be replaced by the defect detection model. The suffix 1 is Segmentation error occurs when two demos are combined

record yourself

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
    
    
   const char b[11] =  "0x1234567a";
   int x;
   printf("%p\n",b);
   std::sscanf(("%p",b),"%x",&x);
   printf("x:::%x",x); 
}

Guess you like

Origin blog.csdn.net/weixin_53610475/article/details/130959560