Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RLlib] Fix CartPole --use-lstm string in policy server test #34458

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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