Skip to content

Commit

Permalink
don't save tensors, convert them to ints (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
rizar authored and maximecb committed Oct 9, 2018
1 parent 39dd6b1 commit d7d61f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/make_agent_demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import time
import numpy as np
import blosc
import torch

import babyai.utils as utils

Expand Down Expand Up @@ -93,6 +94,8 @@ def generate_demos(n_episodes, valid, seed, shift=0):
try:
while not done:
action = agent.act(obs)['action']
if isinstance(action, torch.Tensor):
action = action.item()
new_obs, reward, done, _ = env.step(action)
agent.analyze_feedback(reward, done)

Expand Down

0 comments on commit d7d61f6

Please sign in to comment.