go-rknnlite: can't follow the example. the docker image lacking package?

here is the docker command on example

"A prebuilt [docker image](https://hub.docker.com/repository/docker/swdee/go-rknnlite/general) is available as swdee/go-rknnlite:latest which contains a Debian bookworm OS base with Golang, OpenCV, and GoCV configured.

You can use this image to run your own application or the go-rknnlite examples. For example to run the [MobileNet Demo](https://github.com/swdee/go-rknnlite/blob/master/example/mobilenet) use the following commands.

# from project root directory

docker run --rm \
  --device /dev/dri:/dev/dri \
  -v "$(pwd):/go/src/app" \
  -v "$(pwd)/example/data:/go/src/data" \
  -v "/usr/include/rknn_api.h:/usr/include/rknn_api.h" \
  -v "/usr/lib/librknnrt.so:/usr/lib/librknnrt.so" \
  -w /go/src/app \
  swdee/go-rknnlite:latest \
  go run ./example/mobilenet/mobilenet.go"

here is my command on my terminal:

 docker run --rm -it \
  --device /dev/dri:/dev/dri \
  -v "$(pwd):/go/src/app" \
  -v "$(pwd)/example/data:/go/src/data" \
  -v "/usr/include:/usr/include" \
  -v "/usr/lib/librknnrt.so:/usr/lib/librknnrt.so" \
  -e CGO_CFLAGS="-I/usr/include" \
  -e CGO_LDFLAGS="-L/usr/lib -lrknnrt" \
  -w /go/src/app \
  swdee/go-rknnlite:latest \
  go run ./example/stream/bytetrack.go -a :8080 -s 3 -x person
"
and here is log error 

" docker run --rm -it \
–device /dev/dri:/dev/dri \
-v “$(pwd):/go/src/app” \ -v “$(pwd)/example/data:/go/src/data” \ -v “/usr/include:/usr/include” \ -v “/usr/lib/librknnrt.so:/usr/lib/librknnrt.so” \ -e CGO_CFLAGS=“-I/usr/include” \ -e CGO_LDFLAGS=“-L/usr/lib -lrknnrt” \ -w /go/src/app \ swdee/go-rknnlite:latest \ go run ./example/stream/bytetrack.go -a :8080 -s 3 -x person go: downloading github.com/ctessum/go.clipper v0.1.2 go: downloading gonum.org/v1/gonum v0.15.0

gocv.io/x/gocv

In file included from /usr/local/include/opencv4/opencv2/core.hpp:52, from /usr/local/include/opencv4/opencv2/opencv.hpp:52, from aruco.h:5, from aruco.cpp:1: /usr/local/include/opencv4/opencv2/core/cvdef.h:185:10: fatal error: limits No such file or directory
185 | #include “limits” | ^~~~~~~~ compilation terminated. "

In my understanding it lacking this package "opencv4" which should be inside "[GoCV](https://gocv.io/) is used for image processing. Depending on GoCV's configuration this has subdependencies such as OpenCV, FFMpeg, GStreamer etc which make for a complicated build process. You can either follow [GoCV's installation instructions](https://github.com/hybridgroup/gocv/tree/release#how-to-install) or follow our instructions below."
so i wonder this docker image "swdee/go-rknnlite:latest " have the package preinstalled or which thing should i do wrong.
thank you

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 30 (16 by maintainers)

Most upvoted comments

Stop the vscode node processes you have running to free up some RAM and any other large processes and see if that frees up enough RAM to run.

The dmesg confirms the stream server is being killed by OOM (Out of memory). The stream server process (bytetrack) is using 983MB RAM, but your total system (virtual memory) is ballooning to 3.2GB so the linux kernel kills the stream server as that is the single processes using the most RAM. Do you have any other processes/applications running you can stop to free up some RAM? Does you Ubuntu install have a swapfile setup? What does cat /proc/meminfo show?

lol, my fail. i did kill the “vscode server” and now it run with 400mb Ram left over: Image wil explore the api later. rk3566 is not that bad with 8fps compare to 15fps rv1106

so i wonder the specf of your machine, host version as well as python version

I have not experienced that SIGILL error. There is one similar report here.

I am still using an older version of rknn-toolkit with python 3.9.18

$ python convert.py ../model/yolov5s_relu.onnx rk3566

I rknn-toolkit2 version: 2.1.0+708089d1
--> Config model
done
--> Loading model
I Loading : 100%|██████████████████████████████████████████████| 121/121 [00:00<00:00, 27381.21it/s]
done
--> Building model
I OpFusing 0: 100%|█████████████████████████████████████████████| 100/100 [00:00<00:00, 2326.90it/s]
I OpFusing 1 : 100%|████████████████████████████████████████████| 100/100 [00:00<00:00, 1205.63it/s]
I OpFusing 2 : 100%|████████████████████████████████████████████| 100/100 [00:00<00:00, 1116.32it/s]
I GraphPreparing : 100%|████████████████████████████████████████| 149/149 [00:00<00:00, 7191.04it/s]
I Quantizating : 100%|████████████████████████████████████████████| 149/149 [00:30<00:00,  4.88it/s]
W build: The default input dtype of 'images' is changed from 'float32' to 'int8' in rknn model for performance!
                       Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of 'output0' is changed from 'float32' to 'int8' in rknn model for performance!
                      Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '286' is changed from 'float32' to 'int8' in rknn model for performance!
                      Please take care of this change when deploy rknn model with Runtime API!
W build: The default output dtype of '288' is changed from 'float32' to 'int8' in rknn model for performance!
                      Please take care of this change when deploy rknn model with Runtime API!
I rknn building ...
I rknn buiding done.
done
--> Export rknn model
done

ya, look like joshua version contain only directory. first time i saw that kind of thing like “rknn_api.h” as directory. one question, i try to reinstall rknn_toolkit 2 but there are someconflict “ubuntu version 20.04 - python 3.10 which does not match the rknn_requirement. i am working arround it”. so my question is that can i copy rknn_api.h file from other board or other place as well as this “librknnrt.so” or it need to direclty run from installer ; my board is : radxa zero 3e.

I had a look at the zero3 ubuntu image and it doesn’t have the rknn-toolkit files rknn_api.h and librknnrt.so, so that explains why they are not there.

You could either try Radxa’s debian image or try copying the rknn_api.h and librknnrt.so files across. However you might have other problems if the NPU driver and device tree is not properly setup in Joshua’s ubuntu image so I don’t know if manually copying files across will work successfully.