From 1a6224d4c3e3992479d68930984140d7698abcc5 Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Fri, 7 May 2021 13:04:13 +0100 Subject: [PATCH 1/3] Fix inconsistent version pinning across yaml files. --- .circleci/unittest/linux/scripts/environment.yml | 2 +- .circleci/unittest/windows/scripts/environment.yml | 2 +- packaging/torchvision/meta.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/unittest/linux/scripts/environment.yml b/.circleci/unittest/linux/scripts/environment.yml index dcad1abfa31..8495f8a0a00 100644 --- a/.circleci/unittest/linux/scripts/environment.yml +++ b/.circleci/unittest/linux/scripts/environment.yml @@ -13,6 +13,6 @@ dependencies: - ca-certificates - pip: - future - - pillow>=4.1.1 + - pillow - scipy - av diff --git a/.circleci/unittest/windows/scripts/environment.yml b/.circleci/unittest/windows/scripts/environment.yml index b4f32cb3cad..6d29529bfda 100644 --- a/.circleci/unittest/windows/scripts/environment.yml +++ b/.circleci/unittest/windows/scripts/environment.yml @@ -13,7 +13,7 @@ dependencies: - ca-certificates - pip: - future - - pillow>=4.1.1 + - pillow - scipy - av - dataclasses diff --git a/packaging/torchvision/meta.yaml b/packaging/torchvision/meta.yaml index 8516b2f0ed4..eacecdac0f8 100644 --- a/packaging/torchvision/meta.yaml +++ b/packaging/torchvision/meta.yaml @@ -25,7 +25,7 @@ requirements: - libpng - ffmpeg >=4.2 # [not win] - jpeg - - pillow >=5.3.0 + - pillow {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }} {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT') }} @@ -50,7 +50,7 @@ test: requires: - pytest - scipy - - av >=8.0.1 + - av - jpeg - ca-certificates From 6d55c3a9ce767153cc1dd09bdb81c2d2c6cd3092 Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Sat, 8 May 2021 11:44:55 +0100 Subject: [PATCH 2/3] Pin pillow to >=5.3.0 --- .circleci/unittest/linux/scripts/environment.yml | 2 +- .circleci/unittest/windows/scripts/environment.yml | 2 +- packaging/torchvision/meta.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/unittest/linux/scripts/environment.yml b/.circleci/unittest/linux/scripts/environment.yml index 9d4f9ea5545..710c4829a20 100644 --- a/.circleci/unittest/linux/scripts/environment.yml +++ b/.circleci/unittest/linux/scripts/environment.yml @@ -14,6 +14,6 @@ dependencies: - ca-certificates - pip: - future - - pillow + - pillow >=5.3.0 - scipy - av diff --git a/.circleci/unittest/windows/scripts/environment.yml b/.circleci/unittest/windows/scripts/environment.yml index 1d9b157c6fa..fdc2fe68f64 100644 --- a/.circleci/unittest/windows/scripts/environment.yml +++ b/.circleci/unittest/windows/scripts/environment.yml @@ -14,7 +14,7 @@ dependencies: - ca-certificates - pip: - future - - pillow + - pillow >=5.3.0 - scipy - av - dataclasses diff --git a/packaging/torchvision/meta.yaml b/packaging/torchvision/meta.yaml index 8bbe8e45486..c9b6d04fdc7 100644 --- a/packaging/torchvision/meta.yaml +++ b/packaging/torchvision/meta.yaml @@ -27,7 +27,7 @@ requirements: - ffmpeg >=4.2 # [not win] # NOTE: Pinned to fix issues with size_t on Windows - jpeg <=9b - - pillow + - pillow >=5.3.0 {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }} {{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT') }} From 98aaeec2bf7eddd6b4c93f72db55c5190eb033d3 Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Mon, 10 May 2021 15:37:39 +0100 Subject: [PATCH 3/3] Pin pillow>=5.3.0 everywhere --- .circleci/config.yml | 2 +- .circleci/config.yml.in | 2 +- .circleci/smoke_test/docker/Dockerfile | 6 +++--- .circleci/unittest/linux/scripts/install.sh | 2 +- .circleci/unittest/windows/scripts/install.sh | 2 +- packaging/build_cmake.sh | 2 +- torchvision/transforms/transforms.py | 3 --- 7 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3f22d6b6c35..a12e3af076d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -536,7 +536,7 @@ jobs: fi conda create ${CONDA_CHANNEL_FLAGS} -yn python${PYTHON_VERSION} python=${PYTHON_VERSION} conda activate python${PYTHON_VERSION} - conda install Pillow + conda install Pillow>=5.3.0 conda install -v -y -c pytorch-nightly pytorch conda install -v -y $(ls ~/workspace/torchvision*.tar.bz2) - run: diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index 0984b8bb961..9f56bc129bd 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -536,7 +536,7 @@ jobs: fi conda create ${CONDA_CHANNEL_FLAGS} -yn python${PYTHON_VERSION} python=${PYTHON_VERSION} conda activate python${PYTHON_VERSION} - conda install Pillow + conda install Pillow>=5.3.0 conda install -v -y -c pytorch-nightly pytorch conda install -v -y $(ls ~/workspace/torchvision*.tar.bz2) - run: diff --git a/.circleci/smoke_test/docker/Dockerfile b/.circleci/smoke_test/docker/Dockerfile index b6f25645620..e2227cf5e8b 100644 --- a/.circleci/smoke_test/docker/Dockerfile +++ b/.circleci/smoke_test/docker/Dockerfile @@ -30,7 +30,7 @@ RUN conda create -y --name python3.7 python=3.7 RUN conda create -y --name python3.8 python=3.8 SHELL [ "/bin/bash", "-c" ] RUN echo "source /usr/local/etc/profile.d/conda.sh" >> ~/.bashrc -RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.6 && conda install -y Pillow -RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.7 && conda install -y Pillow -RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.8 && conda install -y Pillow +RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.6 && conda install -y Pillow>=5.3.0 +RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.7 && conda install -y Pillow>=5.3.0 +RUN source /usr/local/etc/profile.d/conda.sh && conda activate python3.8 && conda install -y Pillow>=5.3.0 CMD [ "/bin/bash"] diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index f05c4b59962..7058e4d7095 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -29,7 +29,7 @@ conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c conda-forge "pytorch-${UPLOAD if [ $PYTHON_VERSION == "3.6" ]; then printf "Installing minimal PILLOW version\n" # Install the minimal PILLOW version. Otherwise, let setup.py install the latest - pip install pillow==5.3.0 + pip install pillow>=5.3.0 fi printf "* Installing torchvision\n" diff --git a/.circleci/unittest/windows/scripts/install.sh b/.circleci/unittest/windows/scripts/install.sh index 9c59dd33007..a90e88a71d4 100644 --- a/.circleci/unittest/windows/scripts/install.sh +++ b/.circleci/unittest/windows/scripts/install.sh @@ -31,7 +31,7 @@ conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c conda-forge "pytorch-${UPLOAD if [ $PYTHON_VERSION == "3.6" ]; then printf "Installing minimal PILLOW version\n" # Install the minimal PILLOW version. Otherwise, let setup.py install the latest - pip install pillow==5.3.0 + pip install pillow>=5.3.0 fi printf "* Installing torchvision\n" diff --git a/packaging/build_cmake.sh b/packaging/build_cmake.sh index da758f4b7dc..0945f576ee2 100755 --- a/packaging/build_cmake.sh +++ b/packaging/build_cmake.sh @@ -21,7 +21,7 @@ setup_conda_pytorch_constraint setup_conda_cudatoolkit_plain_constraint if [[ "$OSTYPE" == "msys" ]]; then - conda install -yq conda-build cmake pillow future + conda install -yq conda-build cmake pillow>=5.3.0 future pip install dataclasses fi diff --git a/torchvision/transforms/transforms.py b/torchvision/transforms/transforms.py index dd87cc2b82c..9fa40ec0bad 100644 --- a/torchvision/transforms/transforms.py +++ b/torchvision/transforms/transforms.py @@ -697,7 +697,6 @@ class RandomPerspective(torch.nn.Module): For backward compatibility integer values (e.g. ``PIL.Image.NEAREST``) are still acceptable. fill (sequence or number): Pixel fill value for the area outside the transformed image. Default is ``0``. If given a number, the value is used for all bands respectively. - If input is PIL Image, the options is only available for ``Pillow>=5.0.0``. """ def __init__(self, distortion_scale=0.5, p=0.5, interpolation=InterpolationMode.BILINEAR, fill=0): @@ -1209,7 +1208,6 @@ class RandomRotation(torch.nn.Module): Default is the center of the image. fill (sequence or number): Pixel fill value for the area outside the rotated image. Default is ``0``. If given a number, the value is used for all bands respectively. - If input is PIL Image, the options is only available for ``Pillow>=5.2.0``. resample (int, optional): deprecated argument and will be removed since v0.10.0. Please use the ``interpolation`` parameter instead. @@ -1320,7 +1318,6 @@ class RandomAffine(torch.nn.Module): For backward compatibility integer values (e.g. ``PIL.Image.NEAREST``) are still acceptable. fill (sequence or number): Pixel fill value for the area outside the transformed image. Default is ``0``. If given a number, the value is used for all bands respectively. - If input is PIL Image, the options is only available for ``Pillow>=5.0.0``. fillcolor (sequence or number, optional): deprecated argument and will be removed since v0.10.0. Please use the ``fill`` parameter instead. resample (int, optional): deprecated argument and will be removed since v0.10.0.