Skip to content

Instantly share code, notes, and snippets.

View PavelCz's full-sized avatar
🥸

Pavel C PavelCz

🥸
View GitHub Profile
"""Simple example of setting up a multi-agent policy mapping.
Control the number of agents and policies via --num-agents and --num-policies.
This works with hundreds of agents and policies, but note that initializing
many TF policies will take some time.
Also, TF evals might slow down with large numbers of policies. To debug TF
execution, set the TF_TIMELINE_DIR environment variable.
"""
@PavelCz
PavelCz / slow_rllib_init.py
Last active November 10, 2021 13:42
Debugging script to test rllib initialization with many policies
import time
import gym
import ray
from ray.rllib.agents.ppo import PPOTrainer
from ray.rllib.examples.env.multi_agent import MultiAgentCartPole
from ray.tune import register_env
ray.init()
# get transfer learning training data
!git clone https://github.com/aditya9898/transfer-learning.git
!mv transfer-learning/train train