DeepX-inc/machina

Example code does not run anymore

Closed this issue · 1 comments

I tried to run my distillation code but ran into this problem:

``2019-03-12` 12:57:14.387380 JST | Optimizing...
Traceback (most recent call last):
File "run_ppo.py", line 160, in
optim_pol=optim_pol, optim_vf=optim_vf, epoch=args.epoch_per_iter, batch_size=args.batch_size, max_grad_norm=args.max_grad_norm)
File "/home/pierre/anaconda3/lib/python3.7/site-packages/machina-0.2.0-py3.7.egg/machina/algos/ppo_clip.py", line 126, in train
for batch in iterator:
File "/home/pierre/anaconda3/lib/python3.7/site-packages/machina-0.2.0-py3.7.egg/machina/traj/traj.py", line 182, in iterate
indices = self._get_indices(indices, shuffle)
File "/home/pierre/anaconda3/lib/python3.7/site-packages/machina-0.2.0-py3.7.egg/machina/traj/traj.py", line 128, in _get_indices
self.num_step, device=get_device(), dtype=torch.long)
TypeError: arange() received an invalid combination of arguments - got (numpy.int64, dtype=torch.dtype, device=torch.device), but expected one of:

  • (Number end, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool requires_grad)
  • (Number start, Number end, Number step, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool `requires_grad)``

I also ran run_ppo.py and got the same issue. I think that something got changed in the trajectories file which affects all scripts

Please update your pytorch pip install --upgrade torch