question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Minigrid --" Kernel size can't be greater than actual input size" for DQN

See original GitHub issue

Getting Error: RuntimeError: Calculated padded input size per channel: (3 x 3). Kernel size: (4 x 4). Kernel size can’t be greater than actual input size

`import gym import gym_minigrid from stable_baselines3.common.env_checker import check_env from stable_baselines3 import PPO, A2C from stable_baselines3 import DQN

env = gym.make(‘MiniGrid-Empty-16x16-v0’) check_env(env, warn=True) env = make_vec_env(lambda: env, n_envs=1) model = DQN(“MultiInputPolicy”, env) `

Slight modifications from the original minigrid.py: changed the observation to only the image. tldr; obs = dict(‘image’: array(16,16,3))

I am not quite sure how I should fix this if it’s the layer of NN within the baseline model? Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Miffylicommented, Mar 7, 2022

Next time, please fill in the issue template 😃.

Problem is that with conv layers the output size, which gets smaller on every conv layer, becomes negative. You need to either increase the input shape size or use a different feature extractor (see doc on making custom policies). Same applies to your SB2 issue (please close that one, we can answer questions here).

0reactions
dyllanwlicommented, Apr 1, 2022

Solved by using env_wrapper.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kernel size can't be greater than actual input size #362 - GitHub
When I try to transcribe audio, it throws RuntimeError: Calculated padded input size per channel: (61 x 6). Kernel size: (21 x 11)....
Read more >
Why is CNN convolution output size in PyTorch DQN tutorial ...
No, it's not a mistake because size - (kernel_size - 1) - 1 = size - kernel_size + 2 * 0. with 0...
Read more >
Visual processing in context of reinforcement learning - arXiv
good to start off with a larger learning rate and then make it smaller with time. Determining exactly when to decrease the size...
Read more >
Stanford AI at NeurIPS
Here are the workshops, competitions, and posters from Stanford researchers at this year's machine learning and computational neuroscience ...
Read more >
Fast and slow curiosity for high-level exploration in ...
We evaluate our method on a variety of benchmark environments, including Minigrid, Super Mario Bros, and Atari games. Experimental results show ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found