From 669d352ec773590cd009c130c521650f2bc671a4 Mon Sep 17 00:00:00 2001 From: Vincent Moens Date: Tue, 3 Sep 2024 08:22:37 +0100 Subject: [PATCH] [CI] Fix broken workflows ghstack-source-id: 56beaf2935b18aab56f9c1773c7a7e104de3f74c Pull Request resolved: https://github.com/pytorch/rl/pull/2414 --- .../linux_libs/scripts_minari/environment.yml | 2 +- .github/workflows/build-wheels-windows.yml | 7 +++++-- .github/workflows/docs.yml | 2 +- test/test_loggers.py | 16 +++++++++------- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/unittest/linux_libs/scripts_minari/environment.yml b/.github/unittest/linux_libs/scripts_minari/environment.yml index 27963a42a24..23aedb4cc23 100644 --- a/.github/unittest/linux_libs/scripts_minari/environment.yml +++ b/.github/unittest/linux_libs/scripts_minari/environment.yml @@ -17,4 +17,4 @@ dependencies: - pyyaml - scipy - hydra-core - - minari + - minari[gcs] diff --git a/.github/workflows/build-wheels-windows.yml b/.github/workflows/build-wheels-windows.yml index 9f2666ccdbf..1d47449568c 100644 --- a/.github/workflows/build-wheels-windows.yml +++ b/.github/workflows/build-wheels-windows.yml @@ -32,6 +32,8 @@ jobs: matrix: include: - repository: pytorch/rl + pre-script: .github/scripts/td_script.sh + env-script: .github/scripts/version_script.bat post-script: "python packaging/wheel/relocate.py" smoke-test-script: test/smoke_test.py package-name: torchrl @@ -43,8 +45,9 @@ jobs: test-infra-repository: pytorch/test-infra test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} + pre-script: ${{ matrix.pre-script }} + env-script: ${{ matrix.env-script }} + post-script: ${{ matrix.post-script }} package-name: ${{ matrix.package-name }} smoke-test-script: ${{ matrix.smoke-test-script }} trigger-event: ${{ github.event_name }} - pre-script: .github/scripts/td_script.sh - env-script: .github/scripts/version_script.bat diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c0edc906e78..f5fa29ab7ca 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -50,7 +50,7 @@ jobs: conda activate "${env_dir}" # 2. upgrade pip, ninja and packaging - apt-get install python3.9 python3-pip -y + # apt-get install python3.9 python3-pip -y python3 -m pip install --upgrade pip python3 -m pip install setuptools ninja packaging -U diff --git a/test/test_loggers.py b/test/test_loggers.py index 735911bd95c..eb40ca1fdb8 100644 --- a/test/test_loggers.py +++ b/test/test_loggers.py @@ -281,25 +281,27 @@ def test_log_video(self, wandb_logger): # C - number of image channels (e.g. 3 for RGB), H, W - image dimensions. # the first 64 frames are black and the next 64 are white video = torch.cat( - (torch.zeros(64, 1, 32, 32), torch.full((64, 1, 32, 32), 255)) + (torch.zeros(128, 1, 32, 32), torch.full((128, 1, 32, 32), 255)) ) video = video[None, :] wandb_logger.log_video( name="foo", video=video, - fps=6, + fps=4, + format="mp4", ) wandb_logger.log_video( - name="foo_12fps", + name="foo_16fps", video=video, - fps=24, + fps=16, + format="mp4", ) sleep(0.01) # wait until events are registered # check that fps can be passed and that it has impact on the length of the video - video_6fps_size = wandb_logger.experiment.summary["foo"]["size"] - video_24fps_size = wandb_logger.experiment.summary["foo_12fps"]["size"] - assert video_6fps_size > video_24fps_size, video_6fps_size + video_4fps_size = wandb_logger.experiment.summary["foo"]["size"] + video_16fps_size = wandb_logger.experiment.summary["foo_16fps"]["size"] + assert video_4fps_size > video_16fps_size, (video_4fps_size, video_16fps_size) # check that we catch the error in case the format of the tensor is wrong video_wrong_format = torch.zeros(64, 2, 32, 32)