Closed CWHer closed 2 years ago
If there is no mistake in my code and the above cause exists, I believe there should be a hint in docs to warn users not to use
AsyncCollector
intest_collector
(or maybe add a "forced reset all env" function forasync venv
).
Yes, you are right. Would you like to make a PR to update the docs?
It would be my pleasure and I will make it asap. :smile:
~Sorry, I need more time to figure out why. Because I noticed if I apply the same changes to a test script, there's no exception.~
I can successfully reproduce the same error on test script.
I am not sure whether I'm making some mistakes in my code. When I modified atari rainbow dqn code to apply
AsyncCollector
intest_collector
, it raised the following exceptionI believe the following code patches and running command can reproduce my issue.
I also read the source code of
tianshou
to find out a possible cause:test_episode
function (link) is invoked periodically and it executescollector.reset_env()
everytime. However, forasync venv
,id
is needed inreset_env()
. Besides, there is no such thing as "forced reset all env" forasync venv
.If there is no mistake in my code and the above cause exists, I believe there should be a hint in docs to warn users not to use
AsyncCollector
intest_collector
(or maybe add a "forced reset all env" function forasync venv
).