Closed truongthanh96 closed 5 years ago
Hi,
Thanks for pointing this out. I wasn’t intending to implement GAIL for discrete environments. I think it is not so straightforward to extend GAN/GAIL to discrete settings, although something like Gumbel-SoftMax could work.
Ye
Gym env: CartPole-v1 Affected code File: gailgym.py
Error
To reproduce this error:
python ./gail/save_expert_traj.py --model-path assets/learned_models/CartPole-v1_trpo.p --env-name CartPole-v1 --save-model-interval 100
python ./gail/gail_gym.py --env-name CartPole-v1 --expert-traj-path assets/expert_traj/CartPole-v1_expert_traj.p
This happended because CartPole-v1 's action is discrete, hence:
state = [[0.1,0.2,0.3,0.4],[0.1,0.2,0.3,0.4]]
action = [1,0]
When performing torch.cat thrown this error
Fix suggestion
save_expert_traj doesn't cause error since np.hstack stack element instead concating them.
expert_traj.append(np.hstack([state, action]))