Skip to content

Commit

Permalink
MineDojo not supported by PPO and SAC-AE
Browse files Browse the repository at this point in the history
  • Loading branch information
belerico committed Aug 8, 2023
1 parent 07f7f3b commit 1a716ce
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sheeprl/algos/ppo/ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ def train(
def main():
parser = HfArgumentParser(PPOArgs)
args: PPOArgs = parser.parse_args_into_dataclasses()[0]

if "minedojo" in args.env_id:
raise ValueError(
"MineDojo is not currently supported by PPO agent, since it does not take "
"into consideration the action masks provided by the environment, but needed "
"in order to play correctly the game. "
"As an alternative you can use one of the Dreamers' agents."
)

initial_ent_coef = copy.deepcopy(args.ent_coef)
initial_clip_coef = copy.deepcopy(args.clip_coef)

Expand Down
8 changes: 8 additions & 0 deletions sheeprl/algos/ppo/ppo_decoupled.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,14 @@ def main():
parser = HfArgumentParser(PPOArgs)
args: PPOArgs = parser.parse_args_into_dataclasses()[0]

if "minedojo" in args.env_id:
raise ValueError(
"MineDojo is not currently supported by PPO agent, since it does not take "
"into consideration the action masks provided by the environment, but needed "
"in order to play correctly the game. "
"As an alternative you can use one of the Dreamers' agents."
)

if args.share_data:
warnings.warn(
"You have called the script with `--share_data=True`: "
Expand Down
9 changes: 9 additions & 0 deletions sheeprl/algos/sac_ae/sac_ae.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ def train(
def main():
parser = HfArgumentParser(SACAEArgs)
args: SACAEArgs = parser.parse_args_into_dataclasses()[0]

if "minedojo" in args.env_id:
raise ValueError(
"MineDojo is not currently supported by PPO agent, since it does not take "
"into consideration the action masks provided by the environment, but needed "
"in order to play correctly the game. "
"As an alternative you can use one of the Dreamers' agents."
)

# These arguments cannot be changed
args.screen_size = 64

Expand Down

0 comments on commit 1a716ce

Please sign in to comment.