diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..e422082af --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,14 @@ +image: stablebaselines/stable-baselines3-cpu:0.6.0a7 + +type-check: + script: + - make type + +pytest: + script: + # MKL_THREADING_LAYER=GNU to avoid MKL_THREADING_LAYER=INTEL incompatibility error + - MKL_THREADING_LAYER=GNU make pytest + +doc-build: + script: + - make doc diff --git a/Dockerfile b/Dockerfile index d573be756..be8eb57b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,8 @@ COPY ./stable_baselines3/version.txt ${CODE_DIR}/stable-baselines3/stable_baseli RUN \ cd ${CODE_DIR}/stable-baselines3 3&& \ pip install -e .[extra,tests,docs] && \ + # Use headless version for docker + pip install opencv-python-headless && \ rm -rf $HOME/.cache/pip diff --git a/README.md b/README.md index f14a919e5..c3e9850d2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,7 @@ - +[![pipeline status](https://gitlab.com/araffin/stable-baselines3/badges/master/pipeline.svg)](https://gitlab.com/araffin/stable-baselines3/-/commits/master) [![Documentation Status](https://readthedocs.org/projects/stable-baselines/badge/?version=master)](https://stable-baselines3.readthedocs.io/en/master/?badge=master) [![coverage report](https://gitlab.com/araffin/stable-baselines3/badges/master/coverage.svg)](https://gitlab.com/araffin/stable-baselines3/-/commits/master) -[![Documentation Status](https://readthedocs.org/projects/stable-baselines/badge/?version=master)](https://stable-baselines3.readthedocs.io/en/master/?badge=master) **WARNING: Stable Baselines3 is currently in a beta version, breaking changes may occur before 1.0 is released** diff --git a/docs/misc/changelog.rst b/docs/misc/changelog.rst index baa9919fd..21d5f1fb3 100644 --- a/docs/misc/changelog.rst +++ b/docs/misc/changelog.rst @@ -22,6 +22,7 @@ Bug Fixes: ^^^^^^^^^^ - Fixed a bug that prevented model trained on cpu to be loaded on gpu - Fixed version number that had a new line included +- Fixed weird seg fault in docker image due to FakeImageEnv by reducing screen size Deprecations: ^^^^^^^^^^^^^ diff --git a/stable_baselines3/common/identity_env.py b/stable_baselines3/common/identity_env.py index e1bb9c293..2f3ce28f7 100644 --- a/stable_baselines3/common/identity_env.py +++ b/stable_baselines3/common/identity_env.py @@ -121,9 +121,9 @@ class FakeImageEnv(Env): :param discrete: (bool) """ def __init__(self, action_dim: int = 6, - screen_height: int = 210, - screen_width: int = 160, - n_channels: int = 3, + screen_height: int = 84, + screen_width: int = 84, + n_channels: int = 1, discrete: bool = True): self.observation_space = Box(low=0, high=255, shape=(screen_height, screen_width, diff --git a/tests/test_distributions.py b/tests/test_distributions.py index 1f340bb7d..e9041f8dc 100644 --- a/tests/test_distributions.py +++ b/tests/test_distributions.py @@ -55,8 +55,8 @@ def test_sde_distribution(): dist = dist.proba_distribution(deterministic_actions, log_std, state) actions = dist.get_actions() - assert th.allclose(actions.mean(), dist.distribution.mean.mean(), rtol=1e-3) - assert th.allclose(actions.std(), dist.distribution.scale.mean(), rtol=1e-3) + assert th.allclose(actions.mean(), dist.distribution.mean.mean(), rtol=2e-3) + assert th.allclose(actions.std(), dist.distribution.scale.mean(), rtol=2e-3) # TODO: analytical form for squashed Gaussian?