Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
29 Views

Unable to import openvino on reboot

Jump to solution

Hi,

 

I wrote a script for object detection and if I establish ssh connection to Raspberry Pi and run it from console, everything works fine. As I would like to start the script automatically on boot, I added the entry to the cron table:

@reboot cd /home/pi/workspace/counting-objects && python3 script.py

 

In the cript, I have added following lines before and after import to check whether the import is the issue as I noticed the script was not running:

logger.info("[INFO] Importing libraries for openvino...")
from openvino.inference_engine import IENetwork, IEPlugin
logger.info("[INFO] libraries imported successfully")

In the log file, I saw the first line and the second line was missing, which means an error occurred while trying to import openvino library.

Does anyone know if anything else should be manually added (path variables or anything else) before starting the script? Again, if I just manually run the cript from console, everything works well.

 

0 Kudos

Accepted Solutions
Highlighted
Innovator
29 Views
@Gamulin, Niko "bash" does not read the "/etc/profile", "~/.bash_profile", or "~/.bashrc" file, if one of the following conditions is not satisfied. - It was launched as an interactive shell - Activated with the "--login" option Therefore, When invoking "bash script" with "cron", it means that neither condition is satisfied and it can not be read. - If you want to do it with cron, register as follows. SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # * * * * * user-name command to be executed - If "systemd". Below is a similar issue in my repository. https://github.com/PINTO0309/MobileNet-SSD-RealSense/issues/9 - You need to add the following. source /home/pi/inference_engine_vpu_arm/bin/setupvars.sh

View solution in original post

0 Kudos
1 Reply
Highlighted
Innovator
30 Views
@Gamulin, Niko "bash" does not read the "/etc/profile", "~/.bash_profile", or "~/.bashrc" file, if one of the following conditions is not satisfied. - It was launched as an interactive shell - Activated with the "--login" option Therefore, When invoking "bash script" with "cron", it means that neither condition is satisfied and it can not be read. - If you want to do it with cron, register as follows. SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # * * * * * user-name command to be executed - If "systemd". Below is a similar issue in my repository. https://github.com/PINTO0309/MobileNet-SSD-RealSense/issues/9 - You need to add the following. source /home/pi/inference_engine_vpu_arm/bin/setupvars.sh

View solution in original post

0 Kudos