Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different state and action data type in Fetch_env #25

Closed
HeegerGao opened this issue Apr 8, 2020 · 5 comments
Closed

Different state and action data type in Fetch_env #25

HeegerGao opened this issue Apr 8, 2020 · 5 comments
Labels
enhancement Feature that is not a new algorithm or an algorithm enhancement good first issue Good for newcomers

Comments

@HeegerGao
Copy link

Hello, I am using FetchPickAndPlace-v1 env. The 'obs', 'action' and reward_threshold(There seems no reward_threshold in this env) data type are different from normal gym env. For example, the 'obs' of FetchPickAndPlace-v1 is a dict. This leads to some problems when I run the collector in your code, because the collector seems to assume the 'obs' is a list. So it will come out an error.

@Trinkle23897
Copy link
Collaborator

Can you add an environment wrapper (e.g. gym.Wrapper) to change the dict obs to numpy?

@HeegerGao
Copy link
Author

Oh, it's the first time I know there is a wrapper function to do such kind of things. I'll try it. Thank you!

@Trinkle23897
Copy link
Collaborator

Btw, the collector supports storing a dictionary. On my side, the network will receive a np.array which includes a list of dict. You can extract your desired data like x = np.array([d['observation'] for d in s]) in your network forwarding. It works fine on my side.

@ChenyangRan
Copy link

顺便说一句,收集器支持存储字典。在我这边,网络将收到一个包含字典列表的np.array。您可以像x = np.array([d['observation'] for d in s])在网络转发中一样提取所需的数据。它在我这边工作正常。

Hi, could you please tell me how to save the dic in collect?
I read the guides online, but don't know how to realize.
Because the states and rewards come from collector, I cannot save the desired key into buffer.

@Trinkle23897
Copy link
Collaborator

@ChenyangRan I add this feature yesterday. Please refer to #38

@Trinkle23897 Trinkle23897 added feature request good first issue Good for newcomers enhancement Feature that is not a new algorithm or an algorithm enhancement and removed feature request labels May 5, 2020
BFAnas pushed a commit to BFAnas/tianshou that referenced this issue May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature that is not a new algorithm or an algorithm enhancement good first issue Good for newcomers
Projects
No open projects
Development

No branches or pull requests

3 participants