Install Onnxruntime on RaspberryPI 4

 Currently I have found two ways to get ONNX runtime on RaspberryPI . The first one is a Docker image, and the second one is a compilation on own RaspberryPI. I prefer the second one (link).

Everything is nicely described but I think it is important to know more tools.

1. screens - Some of the compilation commands can run multiple hours, such that your ssh connection can be interrupted, and you will lose a process. To avoid this, you can use screen (good tutorial link)

2. I use Jupyter to test my solutions, as well as virtual environments. To make virtual environment accessible as Jupyter kernel, please check this article.

3. Maybe you will need system packages in you virtual environment. In this case next advice from StackOverflow helps:

Create the environment with virtualenv --system-site-packages . Then, activate the virtualenv and when you want things installed in the virtualenv rather than the system python, use pip install --ignore-installed or pip install -I . That way pip will install what you've requested locally even though a system-wide version exists. Your python interpreter will look first in the virtualenv's package directory, so those packages should shadow the global ones.

 4. It could be that you will need PyTorch also. Good tutorial how to install PyTorch on RaspberryPI can be found in this repo.

5. If you need to have remote connection to Jupyter Notebook running on Raspberry - next commands can be useful:


# Run Jupyter Notebook server on Raspberry
jupyter notebook --port=8890 --no-browser

# Execute port forwarding on the laptop
ssh -N -f -L localhost:8899:localhost:8899  pi@192.168.0.34

Comments

Popular posts from this blog

Install Kubeflow locally

RabbitMQ and OpenShift