openai / gym-http-api

API to access OpenAI Gym from other languages via HTTP
MIT License
292 stars 143 forks source link

C++-Bindings - Example does not run #58

Open kschoos opened 6 years ago

kschoos commented 6 years ago

After installing all the prerequisites and trying to run the random_agent.cpp in cpp bindings, it threw an Error, saying it cannot convert a certain value to float. Changing from Breakout-v0 to CartPole-v0 made it work for the time being.

BoltzmannBrain commented 5 years ago

@kschoos how did you compile and run the C++ example? I'm unable to compile (OSX 10.14):

$ g++ -o gym_exec random_agent.cpp -I include/gym/
Undefined symbols for architecture x86_64:
  "Gym::client_create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
      _main in random_agent-0dd3a4.o
  "Gym::Space::sample()", referenced from:
      run_single_environment(boost::shared_ptr<Gym::Client> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) in random_agent-0dd3a4.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
BoltzmannBrain commented 5 years ago

Found an old makefile here.

oroojlooy commented 5 years ago

The implementation does not support 3D states, i.e., image inputs. You need to call Breakout-ram-v0.

After installing all the prerequisites and trying to run the random_agent.cpp in cpp bindings, it threw an Error, saying it cannot convert a certain value to float. Changing from Breakout-v0 to CartPole-v0 made it work for the time being.