Open jamesborg46 opened 3 years ago
Hi @Indoril007!
Thanks for pointing this out! We're looking into it on our end to see whether a simple fix is possible. Our team has a few deadlines coming up, so we can't promise a fix this week. However, there will be a huge push over the next few months to improve garage's support for image-based observations, CNN policies, and visual algorithms.
In the meantime, we welcome contributions from the community, so if you want to submit a PR, please go for it!
Actually, it seems #2189 might be addressing this issue anyway
In torch/modules/categorical_cnnmodule.py, the module is being reinitialized with every forward pass of the network. I believe this should be move to __init_\. Perhaps it would also be good to change the input_var parameter of categorical_cnn_policy, categorical__cnn_module, cnn_module etc., to simply something like in_channels (or perhaps rely on the observation space grabbed from env_spec similar to other examples) so we no longer need to pass an observation to the module initialization, just the channel dimensions.