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

Assertion failed for multi-agent environment #23

Open
LuisFMCuriel opened this issue Dec 10, 2021 · 2 comments
Open

Assertion failed for multi-agent environment #23

LuisFMCuriel opened this issue Dec 10, 2021 · 2 comments

Comments

@LuisFMCuriel
Copy link
Contributor

Hi,
I am working with the example code for the training of multi-agent env. However, when I create each agent, the expected input for the network is one dimension assert len(in_features) == 1 (see here for FcNet), but my observation space has 3 dimensions: DataSpace(dtype='int8', shape=(6, 7, 2), low=0, high=1). How can I make this work? This network is not available for this environment? Should I flatten the input?

Thanks.

@laszukdawid
Copy link
Owner

Unfortunately at the moment networks don't have a support for multi dimensional input. There were a few examples on pixels (multi dim input), e.g. https://github.com/laszukdawid/ai-traineree/blob/master/examples/space_invaders_pixel_rainbow.py, but I haven't kept it up to date.

You need to convert that input into a single dim tensor. One way is to flatten everything. However, in some cases that might not be the best solution. Another approach, as shown in the example link, is to pass through convolution layers and then do flattening.

At the moment I can't check anything. I'll try to do it within next 24 hours but thought that you might benefit from earlier reply :)

@LuisFMCuriel
Copy link
Contributor Author

Sounds good to me. Is there any reason why you use this specific kernel size? conv_net = ConvNet(state_dim, hidden_layers=(30, 30), kernel_sze=(16, 8), max_pool_size=(4, 2), stride=(4, 2), device=device)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants