hill-a / stable-baselines

A fork of OpenAI Baselines, implementations of reinforcement learning algorithms
http://stable-baselines.readthedocs.io/
MIT License
4.16k stars 725 forks source link

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

Closed raymond2338 closed 2 years ago

raymond2338 commented 2 years ago

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

raymond2338 commented 2 years ago

Being solved here: https://github.com/DLR-RM/stable-baselines3/issues/809#issue-1161876744