Closed Yen-Lung-Huang closed 3 years ago
Hi,
I haven't used Pytorch in the Raspberry Pi, so I am not sure what might be the problem. Have you tested using pytorch in the raspberry pi with other models?
However, I think it will be quite slow in the Raspberry Pi, it would probably better to either convert the model to TFLite and optimize the model or find another model already optimized in TFLite.
Let me know how it goes.
Ibai
Currently I only use Torch in Raspberry Pi and use Tusimple model. I will try TFLite and let you know what I get. Thanks!
I use the instructions provided by the Pytorch official website to download Torch:
I have not tested it but I think in that case it will install a Pytorch version that is not suitable for ARM chips. Make sure that Pytorch work with some simple example. And otherwise, try this method to install Pytorch in a Raspberry Pi: https://gist.github.com/akaanirban/621e63237e63bb169126b537d7a1d979
Thanks ibaiGorordo for the advice. Yes, the Torch I installed using the commands provided on the PyTorch website is not compatible with ARM. I through pytorch - aarch64 installed the torch 1.9.0 and torchvision 0.10.0. Successfully run the Ultrafast-Lane-Detection-Inference-Pytorch- programs on Raspberry Pi 4. However, execution on Pi is very slow, for example, imageLaneDetection.py takes 31 seconds to get output. Next I'm going to try TFLite and tell you what I get.
Run pip3 list and python3 imageLaneDetection.py on terminal:
The output image of imageLaneDetection.py:
I am glad to hear that. About the TFLite model, it might be hard to get it:
https://github.com/cfzd/Ultra-Fast-Lane-Detection/issues/155
But there is probably some lane detector that can run faster in the Raspberry Pi.
Good luck, and let me know how it goes. Ibai
Hi,
I have created a repository for performing the inference in TFLite: https://github.com/ibaiGorordo/TfLite-Ultra-Fast-Lane-Detection-Inference
I have not tested it, but it should run faster than the original model in the Raspberry Pi.
Hello, this program can run successfully on Windows and Ubuntu with AMD64 architecture, but I want to do lane detection on Raspberry Pi 4, as a lightweight and real-time lane detection system, easy to install on the car. On Raspberry Pi 4 with Ubuntu 20.04, I installed the following packages in the Python 3.7 virtual environment using pip3 from requirements.txt("pip3 list" output):
When I run imageLaneDetection.py, videoLaneDetection.py and webcamLaneDetection.py to "output = self. model(input_tensor)" in the class function "inference" in the ultrafastLaneDetector.py caused an unexpected program interrupt and showed "Illegal Instruction" in the terminal window. Why this situation occurs and how to deal with it?
My terminal window output: