LucasAlegre / morl-baselines

Multi-Objective Reinforcement Learning algorithms implementations.
https://lucasalegre.github.io/morl-baselines
MIT License
271 stars 44 forks source link

Using mo-highway environment with morl baselines #76

Closed osikazuzanna closed 10 months ago

osikazuzanna commented 10 months ago

Hi! Thanks for your hard work on these implementations! I've been trying to train an agent in the mo-highway-fast-v0 environment using both Envelope and GPI-PD algorithms, but I get the same error when trying to run it: RuntimeError: Calculated padded input size per channel: (5 x 5). Kernel size: (8 x 8). Kernel size can't be greater than actual input size The error is coming from the QNet definition, more precisely from line 75 in morl_baselines_main/morl_baselines/common/networks.py: self.feature_extractor = NatureCNN(self.obs_shape, features_dim=512)

When running other environments it works ok, so I was wondering if there is something wrong with my code or environment. Thanks in advance for your help!

ffelten commented 10 months ago

Hi @osikazuzanna,

I think you might need to apply a wrapper to flatten the observation before using the CNN. See here: https://github.com/LucasAlegre/morl-baselines/blob/main/experiments/benchmark/launch_experiment.py#L155

Cheers,

Florian

osikazuzanna commented 10 months ago

That works, thank you!!