Mlpack: How to run RL algorithm in OpenAI Gym

Created on 17 Oct 2018  路  3Comments  路  Source: mlpack/mlpack

Hi, I want to run the reinforcement learning algorithm that I made using mlpack in OpenAI Gym for test However, The OpenAI Gym officially provides python version.

So, I have searched the solution to run RL algorithm in OpenAI Gym, and I found that they provides a HTTP API for other languages to run. However, I have encountered some errors.

So, if anyone knows how to run mlpack algorithm in OpenAI gym, please let me know.
Thank you :)

Most helpful comment

@HelioStrike
Hi, HelioStrike!!
I went through some trial and error to run the program. In the end, I succeeded to run it correctly.
So, I write the trial and error that I went through

  1. To install required dependencies, I should type the command "mix deps.get". But, the error message was printed.
$ mix deps.get
Failed to fetch record for 'hexpm/poolboy' from registry (using cache)
{:failed_connect, [{:to_address, {'localhost', 4001}}, {:inet, [:inet], :econnrefused}]}
** (Mix) Unknown package poolboy in lockfile

SOL) This was a cache problem, I figured out thanks to @zoq, and just removed the cache file.
rm "~/.hex/cache.ets"

  1. In the client side, to connect to server, I should type the command to run client program that wrote in c++, the below error was printed.
$ ./example
terminate called after throwing an instance of 'boost::system::system_error'
  what():  Connection refused
Aborted (core dumped)

SOL) I changed the line 17 code const std::string host = "kurg.org"; to const std::string host = "127.0.0.1"; in example.cpp and then the program is working correctly.

Thank you!!

All 3 comments

I found this a few days ago while going through this page. I haven't used it yet, so I can't give you much info, but I hope I helped. :)

@HelioStrike
Thank you so much, actually I has tried the solution before, but I encountered some errors... currently I'm trying to solve it.
If I solve it, I will share the methods that I did to fix.

@HelioStrike
Hi, HelioStrike!!
I went through some trial and error to run the program. In the end, I succeeded to run it correctly.
So, I write the trial and error that I went through

  1. To install required dependencies, I should type the command "mix deps.get". But, the error message was printed.
$ mix deps.get
Failed to fetch record for 'hexpm/poolboy' from registry (using cache)
{:failed_connect, [{:to_address, {'localhost', 4001}}, {:inet, [:inet], :econnrefused}]}
** (Mix) Unknown package poolboy in lockfile

SOL) This was a cache problem, I figured out thanks to @zoq, and just removed the cache file.
rm "~/.hex/cache.ets"

  1. In the client side, to connect to server, I should type the command to run client program that wrote in c++, the below error was printed.
$ ./example
terminate called after throwing an instance of 'boost::system::system_error'
  what():  Connection refused
Aborted (core dumped)

SOL) I changed the line 17 code const std::string host = "kurg.org"; to const std::string host = "127.0.0.1"; in example.cpp and then the program is working correctly.

Thank you!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

windstyle picture windstyle  路  3Comments

mrityunjay-tripathi picture mrityunjay-tripathi  路  6Comments

yurivict picture yurivict  路  5Comments

FloopCZ picture FloopCZ  路  6Comments

mirraaj picture mirraaj  路  3Comments