thu-ml / tianshou

An elegant PyTorch deep reinforcement learning library.
https://tianshou.org
MIT License
7.78k stars 1.12k forks source link

v0.4.9 run offline test_gail script throw venvs error #744

Closed Rocky-L closed 1 year ago

Rocky-L commented 1 year ago

Run Command:

$ python test/offline/test_gail.py

Traceback (most recent call last): File "test/offline/test_gail.py", line 232, in test_gail() File "test/offline/test_gail.py", line 202, in test_gail result = onpolicy_trainer( File "/Users/elbert.li/projects/scripts/coach/tianshou/tianshou/trainer/onpolicy.py", line 150, in onpolicy_trainer return OnpolicyTrainer(*args, **kwargs).run() File "/Users/elbert.li/projects/scripts/coach/tianshou/tianshou/trainer/base.py", line 440, in run deque(self, maxlen=0) # feed the entire iterator into a zero-length deque File "/Users/elbert.li/projects/scripts/coach/tianshou/tianshou/trainer/base.py", line 252, in iter self.reset() File "/Users/elbert.li/projects/scripts/coach/tianshou/tianshou/trainer/base.py", line 237, in reset test_result = test_episode( File "/Users/elbert.li/projects/scripts/coach/tianshou/tianshou/trainer/utils.py", line 27, in test_episode result = collector.collect(n_episode=n_episode) File "/Users/elbert.li/projects/scripts/coach/tianshou/tianshou/data/collector.py", line 304, in collect result = self.env.step(action_remap, ready_env_ids) # type: ignore File "/Users/elbert.li/projects/scripts/coach/tianshou/tianshou/env/venvs.py", line 272, in step obs, rew, done, info = self.workers[j].recv() # type: ignore ValueError: too many values to unpack (expected 4)

Any idea how to fix this issue?

Trinkle23897 commented 1 year ago

Downgrade gym version to <=0.25

Rocky-L commented 1 year ago

Downgrade gym version to <=0.25

Problem Solved!