简体   繁体   中英

Problem launching working .sh script in cron using python, tensorflow

I have a working script.sh python /opt/facenet/src/train.py . When I try to launch it in cron I get this error: ImportError: No module named tensorflow . I've tried this solution to find tensorflow location like this: import tensorflow tensorflow.__file__ /home/user/anaconda3/lib/site-packages/tensorflow/__init__.pyc So I've changed the path to the libraries, executed like this: /home/user/anaconda3/lib/site-packages /opt/facenet/src/train.py and got the following mistake: /home/user/anaconda3/lib/site-packages: Permission denied . I tried to fix it in many ways: chmod x+u and so on. But I still get the same mistake. Any ideas on how to fix it?

Check this thread link . Apparently, downgrading Tensorflow solves it.

pip3 uninstall tensorflow-gpu
pip3 install --upgrade tensorflow-gpu==1.4

Note: Make sure you're doing this in the environment you use to run the scripts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM