muupan / dqn-in-the-caffe

An implementation of Deep Q-Network using Caffe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined references to `DisplayScreen::display_screen(MediaSource const&)

onlytailei opened this issue · comments

Hi, I use the caffe-dqn as the caffe, and when I do make, I got this.

CMakeFiles/dqn.dir/dqn_main.cpp.o: In function `PlayOneEpisode(ALEInterface&, dqn::DQN&, double, bool)':
dqn_main.cpp:(.text+0xd14): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
dqn_main.cpp:(.text+0x1124): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
CMakeFiles/dqn.dir/dqn_main.cpp.o: In function `PlayOneEpisode(ALEInterface&, dqn::DQN&, double, bool) [clone .constprop.106]':
dqn_main.cpp:(.text+0x2414): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
dqn_main.cpp:(.text+0x283c): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
CMakeFiles/dqn.dir/dqn_main.cpp.o: In function `main':
dqn_main.cpp:(.text.startup+0xc20): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
CMakeFiles/dqn.dir/dqn_main.cpp.o:dqn_main.cpp:(.text.startup+0x10a8): more undefined references to `DisplayScreen::display_screen(MediaSource const&)' follow
collect2: error: ld returned 1 exit status
make[2]: *** [dqn] Error 1
make[1]: *** [CMakeFiles/dqn.dir/all] Error 2
make: *** [all] Error 2

By the way, there are also some warnnings:

In file included from /home/tyler_asus/Software/dqn-in-the-caffe/dqn_main.cpp:3:0:
/home/tyler_asus/Software/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<OSystem> theOSystem;
                            ^
/home/tyler_asus/Software/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<Settings> theSettings;
                             ^
/home/tyler_asus/Software/ale_0.4.4/ale_0_4/src/ale_interface.hpp: In function ‘void createOSystem(int, char**, std::auto_ptr<OSystem>&, std::auto_ptr<Settings>&)’:
/home/tyler_asus/Software/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);

I'm using the latest Caffe and I'm not seeing this, though I had to mess with the model and I've not got that to work yet :-( I've also see various warnings about auto pointers and those don't seem to be the problem. I'm either going to figure out how to get the model updated to run with the current caffe or go back to the old dqn-caffe as your doing.

same problem here, using your caffe repository. Did you solve it?
Why does it happen during the link process?

Linking CXX executable dqn
CMakeFiles/dqn.dir/dqn_main.cpp.o: In function `PlayOneEpisode(ALEInterface&, dqn::DQN&, double, bool)':
dqn_main.cpp:(.text+0xd14): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
dqn_main.cpp:(.text+0x1124): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
CMakeFiles/dqn.dir/dqn_main.cpp.o: In function `PlayOneEpisode(ALEInterface&, dqn::DQN&, double, bool) [clone .constprop.108]':
dqn_main.cpp:(.text+0x2414): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
dqn_main.cpp:(.text+0x283c): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
CMakeFiles/dqn.dir/dqn_main.cpp.o: In function `main':
dqn_main.cpp:(.text.startup+0xc20): undefined reference to `DisplayScreen::display_screen(MediaSource const&)'
CMakeFiles/dqn.dir/dqn_main.cpp.o:dqn_main.cpp:(.text.startup+0x10a8): more undefined references to `DisplayScreen::display_screen(MediaSource const&)' follow
collect2: error: ld returned 1 exit status

According to your CMakeLists.txt, I use the same ale version 0.4.4

The solution is to compile ale with USE_SDL := 1, even if you turned it off in CMakeFiles.txt

Sorry kilmarnock.
I implement the dqn network in other environment but not the Atari game. So finally I did not use the SQL.
Hope you have solved it successfully.