Skip to content

Commit

Permalink
Fix AttributeError in case spec is None
Browse files Browse the repository at this point in the history
  • Loading branch information
dantp-ai committed Jan 4, 2024
1 parent 7c28ff7 commit 27fbd16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/offline/test_bcq.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ def test_bcq(args: argparse.Namespace = get_args()) -> None:
if args.reward_threshold is None:
# too low?
default_reward_threshold = {"Pendulum-v0": -1100, "Pendulum-v1": -1100}
args.reward_threshold = default_reward_threshold.get(args.task, env.spec.reward_threshold)
args.reward_threshold = default_reward_threshold.get(
args.task,
env.spec.reward_threshold if env.spec else None,
)

args.state_dim = args.state_shape[0]
args.action_dim = args.action_shape[0]
Expand Down

0 comments on commit 27fbd16

Please sign in to comment.