digits调用出现:ValueError: Caffe executable not found in PATH

问题:

  ___ ___ ___ ___ _____ ___
 |   \_ _/ __|_ _|_   _/ __|
 | |) | | (_ || |  | | \__ \
 |___/___\___|___| |_| |___/ 6.1.1
A valid Caffe installation was not found on your system.
Use the envvar CAFFE_ROOT to indicate a valid installation.
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/yuki/digits/digits/__main__.py", line 70, in <module>
    main()
  File "/home/yuki/digits/digits/__main__.py", line 53, in main
    import digits.config
  File "digits/config/__init__.py", line 7, in <module>
    from . import (  # noqa
  File "digits/config/caffe.py", line 230, in <module>
    executable, version, flavor = load_from_path()
  File "digits/config/caffe.py", line 54, in load_from_path
    raise ValueError('Caffe executable not found in PATH')
ValueError: Caffe executable not found in PATH

解决办法:

  1. 检查当前envvar的值,命令:echo $CAFFE_ROOT
  2. 把envvar加到/etc/profile中,下次当你登录时会自动加载。注意:这里是加入/etc/profile而不是~/.bashrc,因为使用ssh登录时每次都要进行一次source ~/.bashrc才能用,所以干脆放在所有用户的配置文件里面。命令:echo "export CAFFE_ROOT=(caffe文件夹所在位置)" >> /etc/profile
  3. 加载新配置,命令:source /etc/profile
  4. 检查一下,命令echo $CAFFE_ROOT,可以看到位置信息。

例如:

yuki@yuki:~/digits$ echo $CAFFE_ROOT
/home/yuki/caffe

猜你喜欢

转载自blog.csdn.net/chenhuan20123/article/details/79615529
今日推荐