facebookresearch / ReAgent

A platform for Reasoning systems (Reinforcement Learning, Contextual Bandits, etc.)
https://reagent.ai
BSD 3-Clause "New" or "Revised" License
3.56k stars 516 forks source link

Quickstart Examples Not Working #461

Open avilay opened 3 years ago

avilay commented 3 years ago

The following commands result in an AttributeError: module 'reagent.gym.tests.test_gym' has no attribute 'run_test’ because the module test_gym does not exist.

export CONFIG=reagent/gym/tests/configs/cartpole/discrete_dqn_cartpole_online.yaml
./reagent/workflow/cli.py run reagent.gym.tests.test_gym.run_test $CONFIG

See full stacktrace here.

Even when I try to run one of the existing modules like run_test_online_episode I get a KeyError: 'state_features'...float_features=batch[InputColumn.STATE_FEATURES]

Here is the full command:

./reagent/workflow/cli.py run reagent.gym.tests.test_gym.run_test_online_episode $CONFIG

See full stacktrace here

On further trying the batch RL example the first command running the offline_gym module works fine. However, the second command running the timeline_operator errors out with java.lang.StringIndexOutOfBoundsException: begin 0, end 3, length 2. Here are the full commands that I ran:

export CONFIG=reagent/workflow/sample_configs/discrete_dqn_cartpole_offline.yaml
./reagent/workflow/cli.py run reagent.workflow.gym_batch_rl.offline_gym $CONFIG
./reagent/workflow/cli.py run reagent.workflow.gym_batch_rl.timeline_operator $CONFIG

See full stacktrace here

Here are my environment details:

oshrinm commented 3 years ago

I was having the same issue, and after looking through test_gym.py code change history, I believe run_test was renamed run_test_replay_buffer. I tried:

./reagent/workflow/cli.py run reagent.gym.tests.test_gym.run_test_replay_buffer $CONFIG

and got it to work.

rangi513 commented 3 years ago

For your first problem, @oshrinm's solution above worked for me. Similar solution to the 2nd problem where you had:

./reagent/workflow/cli.py run reagent.workflow.gym_batch_rl.offline_gym $CONFIG

Replace that with:

./reagent/workflow/cli.py run reagent.workflow.gym_batch_rl.offline_gym_random $CONFIG

Looks like this was also renamed - I think the documentation just needs to be updated.