araffin / rl-baselines-zoo

A collection of 100+ pre-trained RL agents using Stable Baselines, training and hyperparameter optimization included.
https://stable-baselines.readthedocs.io/
MIT License
1.13k stars 208 forks source link

import DDPG failed #81

Closed JohannesUl closed 4 years ago

JohannesUl commented 4 years ago

Consider adding something like

try:
    import mpi4py
except ImportError:
    mpi4py = None

if mpi4py is not None:
    from stable_baselines import DDPG
    from stable_baselines.ddpg import AdaptiveParamNoiseSpec, NormalActionNoise, OrnsteinUhlenbeckActionNoise
del mpi4py

in hyperparameters_opt.py. This would avoid errors if stable-baselines 2.10.0 is installed without mpi and would comply with https://github.com/hill-a/stable-baselines/blob/master/stable_baselines/__init__.py

Best, Johannes

araffin commented 4 years ago

Hello, I would appreciate a PR that solves that issue ;)