caffe安装:cuda_runtime.h: No such file or directory

转载:https://gitter.im/BVLC/caffe/archives/2015/08/20

Hi guys

need some help!

I have this error when trying to install caffe

CXX src/caffe/parallel.cpp
src/caffe/parallel.cpp:2:26: fatal error: cuda_runtime.h: No such file or directory

include <cuda_runtime.h>

                      ^

compilation terminated.
make: * [.build_release/src/caffe/parallel.o] Error 1
ubuntu@ip-172-31-43-3:~/caffe1/caffe-master$
ubuntu@ip-172-31-43-3:~/caffe1/caffe-master$ sudo make all
CXX src/caffe/parallel.cpp
src/caffe/parallel.cpp:2:26: fatal error: cuda_runtime.h: No such file or directory

include <cuda_runtime.h>

                      ^

compilation terminated.
make: * [.build_release/src/caffe/parallel.o] Error 1

Tomas Wood

 

@odellus

8月 20 2015 09:39

Try cmake. Your cuda is not where the Makefile is looking for it.

juicybatman

 

@juicybatman

8月 20 2015 09:48

I'm not using cuda! im just using caffe cpu only

i've tried it with cmake but i can't get past the last step where you test caffe with a c++ aplication

Tomas Wood

 

@odellus

8月 20 2015 10:20

try cmake -DCPU_ONLY=1 ../caffe

Darshan Chaudhary

 

@darshanime

8月 20 2015 11:13

Hello. I have complied Caffe successfully

But I am facing a problem in compiling pyCaffe

This is my stack :

This message was deleted

This message was deleted

~/caffe$ make pycaffe
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
python/caffe/_caffe.cpp:1:52: fatal error: Python.h: No such file or directory
 #include <Python.h>  // NOLINT(build/include_alpha)
                                                    ^
compilation terminated.
make: *** [python/caffe/_caffe.so] Error 1

Locating the file gives :

~/caffe$ locate Python.h
/home/radar/anaconda/envs/sympy-dev/include/python2.7/Python.h
/home/radar/anaconda/include/python2.7/Python.h
/home/radar/anaconda/pkgs/python-2.7.10-0/include/python2.7/Python.h
/home/radar/anaconda/pkgs/python-2.7.8-1/include/python2.7/Python.h
/home/radar/anaconda/pkgs/python-2.7.9-1/include/python2.7/Python.h
/home/radar/anaconda/pkgs/python-3.4.1-4/include/python3.4m/Python.h
/home/radar/anaconda/pkgs/python-3.4.3-1/include/python3.4m/Python.h
/usr/include/python2.7/Python.h
/usr/include/python3.4m/Python.h
/usr/include/vtk-5.8/vtkPython.h

I think I have to use /home/radar/anaconda/include/python2.7/Python.h

Prasanna S

 

@IMG-PRCSNG

8月 20 2015 14:18

@darshanime , The problem might be in the python include path of your Makefile.config Recheck it.

Darshan Chaudhary

 

@darshanime

8月 20 2015 14:54So, I did what you asked :

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /home/radar/anaconda/include/python2.7
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /home/radar/anaconda/include/python2.7

This message was deleted

This 'installed' pycaffe with out any complains.
Here is the stdout :

~/caffe$ make pycaffe
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
touch python/caffe/proto/__init__.py
PROTOC (python) src/caffe/proto/caffe.proto
~/caffe$

Now, when I try to run detect.py, I get this error :

~/caffe/python$ python detect.py 
Traceback (most recent call last):
  File "detect.py", line 24, in <module>
    import caffe
  File "/home/radar/caffe/python/caffe/__init__.py", line 1, in <module>
    from .pycaffe import Net, SGDSolver
  File "/home/radar/caffe/python/caffe/pycaffe.py", line 14, in <module>
    import caffe.io
  File "/home/radar/caffe/python/caffe/io.py", line 8, in <module>
    from caffe.proto import caffe_pb2
  File "/home/radar/caffe/python/caffe/proto/caffe_pb2.py", line 4, in <module>
    from google.protobuf.internal import enum_type_wrapper
ImportError: No module named google.protobuf.internal

How can I resolve this ?

Darshan Chaudhary

 

@darshanime

8月 20 2015 15:03

IT'S WORKING !

The simple pip install protobuf was all that was needed.

Prasanna S

 

@IMG-PRCSNG

8月 20 2015 17:13

@darshaninme , or a sudo apt-get install python-protobuf would too

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值