Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error: caffe/proto/caffe.pb.h: No such file or directory #include "caffe/proto/caffe.pb.h" #3

Closed
AjayTalati opened this issue Jan 21, 2015 · 9 comments

Comments

@AjayTalati
Copy link

Sorry I closed the previous issue by mistake?

Here's the exact output I get, when I try to make dqn-in-the-caffe

ajay@ajay-h8-1170uk:$ cd /home/ajay/CppProjects/dqn_caffe/build
ajay@ajay-h8-1170uk:
/CppProjects/dqn_caffe/build$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ajay/CppProjects/dqn_caffe/build
ajay@ajay-h8-1170uk:~/CppProjects/dqn_caffe/build$ make
[ 50%] Building CXX object CMakeFiles/dqn.dir/dqn_main.cpp.o
In file included from /home/ajay/bin/caffe/include/caffe/caffe.hpp:7:0,
from /home/ajay/CppProjects/dqn_caffe/dqn.hpp:10,
from /home/ajay/CppProjects/dqn_caffe/dqn_main.cpp:7:
/home/ajay/bin/caffe/include/caffe/blob.hpp:5:34: fatal error: caffe/proto/caffe.pb.h: No such file or directory

include "caffe/proto/caffe.pb.h"

^
compilation terminated.
make[2]: *** [CMakeFiles/dqn.dir/dqn_main.cpp.o] Error 1
make[1]: *** [CMakeFiles/dqn.dir/all] Error 2
make: *** [all] Error 2

and the CMakeLists.txt I using for cmake

cmake_minimum_required (VERSION 2.6)
project(dqn)

option(CPU_ONLY "Use CPU only for Caffe" ON)
option(USE_CUDNN "Use cuDNN for Caffe" OFF)
option(USE_SDL "Use SDL for ALE" ON)

include_directories(/usr/local/caffe/include)

include_directories(/usr/local/ale_cpp/ale_0.4.4/ale_0_4/src)

link_directories(/usr/local/caffe/build/lib)

link_directories(/usr/local/ale_cpp/ale_0.4.4/ale_0_4)

include_directories(/home/ajay/bin/caffe/include)
include_directories(/usr/local/ale_cpp/ale_0.4.4/ale_0_4/src)
link_directories(/home/ajay/bin/caffe/build/lib)
link_directories(/usr/local/ale_cpp/ale_0.4.4/ale_0_4)

if(USE_CUDNN)
link_directories(~/cudnn-6.5-linux-R1)
endif()

add_executable(dqn dqn_main.cpp dqn.cpp)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -march=native")

target_link_libraries(dqn caffe)
target_link_libraries(dqn glog)
target_link_libraries(dqn gflags)
target_link_libraries(dqn ale)

It definitely seems like its a problem with how I'm installing caffe, but it passes all the tests, and works for MNIST? I've tried to reinstall it 3 times but no luck?

@muupan
Copy link
Owner

muupan commented Jan 21, 2015

You need to generate caffe.pb.h manually using protoc as follows.

# In the directory you installed Caffe to
protoc src/caffe/proto/caffe.proto --cpp_out=.
mkdir include/caffe/proto
mv src/caffe/proto/caffe.pb.h include/caffe/proto

@AjayTalati
Copy link
Author

Hi, thanks a lot for the help! I really appreciate it :)

We're making progress, but now there seems to be a problem with a solver?

ajay@ajay-h8-1170uk:~/CppProjects/dqn-in-the-caffe-master/build$ make
Scanning dependencies of target dqn
[ 50%] Building CXX object CMakeFiles/dqn.dir/dqn_main.cpp.o
In file included from /home/ajay/CppProjects/dqn-in-the-caffe-master/dqn_main.cpp:3:0:
/usr/local/ale_cpp/ale_0.4.4/ale_0_4/src/ale_interface.hpp:124:28: warning: ‘auto_ptr’ is deprecated (declared at /usr/include/c++/4.8/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
std::auto_ptr theOSystem;
^
/usr/local/ale_cpp/ale_0.4.4/ale_0_4/src/ale_interface.hpp:125:29: warning: ‘auto_ptr’ is deprecated (declared at /usr/include/c++/4.8/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
std::auto_ptr theSettings;
^
/usr/local/ale_cpp/ale_0.4.4/ale_0_4/src/ale_interface.hpp: In function ‘void createOSystem(int, char*, std::auto_ptr&, std::auto_ptr&)’:
/usr/local/ale_cpp/ale_0.4.4/ale_0_4/src/ale_interface.hpp:84:49: warning: ignoring return value of ‘FILE
freopen(const char_, const char_, FILE_)’, declared with attribute warn_unused_result [-Wunused-result]
freopen(outputFile.c_str(), "w", stdout);
^
[100%] Building CXX object CMakeFiles/dqn.dir/dqn.cpp.o
In file included from /home/ajay/CppProjects/dqn-in-the-caffe-master/dqn.hpp:9:0,
from /home/ajay/CppProjects/dqn-in-the-caffe-master/dqn.cpp:1:
/usr/local/ale_cpp/ale_0.4.4/ale_0_4/src/ale_interface.hpp:124:28: warning: ‘auto_ptr’ is deprecated (declared at /usr/include/c++/4.8/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
std::auto_ptr theOSystem;
^
/usr/local/ale_cpp/ale_0.4.4/ale_0_4/src/ale_interface.hpp:125:29: warning: ‘auto_ptr’ is deprecated (declared at /usr/include/c++/4.8/backward/auto_ptr.h:87) [-Wdeprecated-declarations]
std::auto_ptr theSettings;
^
/home/ajay/CppProjects/dqn-in-the-caffe-master/dqn.cpp: In member function ‘void dqn::DQN::Update()’:
/home/ajay/CppProjects/dqn-in-the-caffe-master/dqn.cpp:350:12: error: ‘class caffe::Solver’ has no member named ‘Step’
solver_->Step(1);
^
make[2]: *_* [CMakeFiles/dqn.dir/dqn.cpp.o] Error 1
make[1]: *** [CMakeFiles/dqn.dir/all] Error 2
make: *** [all] Error 2

I can't find anything on the internet about this one

@muupan
Copy link
Owner

muupan commented Jan 21, 2015

The message shows BVLC/caffe#1228 is not merged into your caffe. DQN-in-the-caffe depends on that PR.

I've tested DQN-in-the-caffe only with my forked caffe branch https://github.com/muupan/caffe/tree/dqn, so I recommend you use it.

@AjayTalati
Copy link
Author

Great! Thanks, I've built it all sucessfully, and have some note/docs, if any one else needs help?

screenshot from 2015-01-21 21 10 25

I'll be testing it tonight and over the weekend on pong. Will get back to you 👍

May I ask if you've ever tested your code on freeway.bin or othello.bin

@muupan
Copy link
Owner

muupan commented Jan 22, 2015

Congratulations! I hope to hear the results. I've never tried freeway nor othello yet.

@IdiosyncraticDragon
Copy link

@muupan thank you! It's really helpful.

@godisboy
Copy link

Thank you! It works!

@edWin-m
Copy link

edWin-m commented Apr 5, 2017

@muupan Thanks

@ecilay
Copy link

ecilay commented Apr 29, 2017

hi @muupan , after implement your suggestions, still the same error...any other advices? tks!
`# In the directory you installed Caffe to

protoc src/caffe/proto/caffe.proto --cpp_out=.

mkdir include/caffe/proto

mv src/caffe/proto/caffe.pb.h include/caffe/proto`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants