Skip to content

Commit

Permalink
[RLlib] fix cartpole lstm string (ray-project#34458)
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Niederfahrenhorst <[email protected]>
Signed-off-by: Jack He <[email protected]>
  • Loading branch information
ArturNiederfahrenhorst authored and ProjectsByJackHe committed May 4, 2023
1 parent 02340c0 commit 594f6dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rllib/env/tests/test_policy_client_server_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,28 @@ if [ "$2" == "cartpole" ]; then
client_script=cartpole_client.py
stop_criterion="--stop-reward=150.0"
trainer_cls="PPO"
use_lstm=""
elif [ "$2" == "cartpole_lstm" ]; then
server_script=cartpole_server.py
client_script=cartpole_client.py
stop_criterion="--stop-reward=150.0"
trainer_cls="IMPALA --use-lstm"
trainer_cls="IMPALA"
use_lstm="--use-lstm"
# Unity3D dummy setup.
elif [ "$2" == "unity3d" ]; then
server_script=unity3d_server.py
client_script=unity3d_dummy_client.py
stop_criterion="--num-episodes=10"
trainer_cls="PPO"
use_lstm=""
# CartPole dummy test using 2 simultaneous episodes on the client.
# One episode has training_enabled=False (its data should NOT arrive at server).
else
server_script=cartpole_server.py
client_script=dummy_client_with_two_episodes.py
stop_criterion="--dummy-arg=dummy" # no stop criterion: client script terminates either way
trainer_cls="PPO"
use_lstm=""
fi

port=$3
Expand All @@ -56,7 +60,7 @@ fi
# Start server with 2 workers (will listen on ports worker_1_port and worker_2_port for client
# connections).
# Do not attempt to restore from checkpoint; leads to errors on travis.
(python $basedir/$server_script --run="$trainer_cls" --num-workers=2 --no-restore --port=$worker_1_port 2>&1 | grep -v 200) &
(python $basedir/$server_script --run="$trainer_cls" --num-workers=2 $use_lstm --no-restore --port=$worker_1_port 2>&1 | grep -v 200) &
server_pid=$!

echo "Waiting for server to start ..."
Expand Down

0 comments on commit 594f6dd

Please sign in to comment.