Closed qmpzzpmq closed 7 months ago
Hi. You seem to be using some older version of tianshou, could you pls try again after installing from master?
I just tried examples/discrete/discrete_dqn.py
, and it runs through without problems.
Apart from switching to the latest version - a reason for this failure may be the fact that your observation space is a dict (in fact, I think it's very likely). Tianshou should in principle support this, but there has been a lot of work on improving the internals of tianshou recently, and we haven't focused on dict spaces.
We will include and test support for dict observations at some point in the future, but it's not our priority. It's usually easy to adjust your environment to have a Discrete/Box observation space - either in the env itself or through an env wrapper.
Some general recommendations for getting something running on your env:
examples/discrete/discrete_dqn_hl.py
).gym.register
and gym.make
mechanism for custom envs. You can easily just instantiate your env directly, and write a factory for it (or use a lambda)gym.make
, it would be trivial to write and use an env wrapper that turns your Dict space into Discrete, and make use of this wrapper in your EnvFactory@opcode81 @Trinkle23897 FYI. I'm making a new issue for Dict space support
If you want to have a look into it @qmpzzpmq, I set up #1065 for outlining the problem
@MischaPanch thanks for your reply, my tianshou version is 0.5.1. I guess is the newest version of tianshou in pip.
Could you install the version on master instead?
Closing as stale. FYI: new version of tianshou has been released, you can install it with pip
Hi, when I run my toy script, I find a bug have a question about this:
when
batch
input in Policy class'sforward
function, it isBatch
type. but it will input to the model, and the model'sobs
input's type actually is tensor/ndarray, I cannot find the transition mechanism.so my toy mechanism is:
and the env is defined as:
the bug is: