Closed chaennlee closed 8 months ago
It was caused by the number of return values of reset() and step() functions.
Change lines 77 and 137 from ob = env.reset()
to ob,_ = env.reset()
Change lines 88 and 150 from ob, rwd, done, info = env.step(act)
to ob, rwd, done, info,_ = env.step(act)
I got this error(ubuntu 20.04 ver)
(base) codms@codms-T-Series:~/gail-pytorch$ python train.py --env_name=BipedalWalker-v3 /home/codms/gail-pytorch/models/nets.py:128: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at /croot/pytorch_1686931851744/work/torch/csrc/utils/tensor_new.cpp:245.) state = FloatTensor(state) Traceback (most recent call last): File "/home/codms/gail-pytorch/train.py", line 98, in
main(**vars(args))
File "/home/codms/gail-pytorch/train.py", line 65, in main
results = model.train(env, expert)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/codms/gail-pytorch/models/gail.py", line 80, in train
act = expert.act(ob)
^^^^^^^^^^^^^^
File "/home/codms/gail-pytorch/models/nets.py", line 128, in act
state = FloatTensor(state)
^^^^^^^^^^^^^^^^^^
ValueError: expected sequence of length 24 at dim 1 (got 0)