Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Unable to import openvino on reboot

nikogamulin
Beginner
560 Views

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
1 Solution
Hyodo__Katsuya
Innovator
560 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
Hyodo__Katsuya
Innovator
561 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
0 Kudos
Reply