"git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "c8cd3ff9eb87e5190a04cd1e4cc970b43410da59"
Unverified Commit c890a7e7 authored by Nikita Shulga's avatar Nikita Shulga Committed by GitHub
Browse files

[M1] Install "jpeg<=9b" rather than OpenJpeg (#6122)

Explicitly set PATH to point to `conda` binary, otherwise libjpeg detection logic does not work
Pin libjpeg to the same version on x86 and m1
Add simple tests that jpeg can be decoded by a generated wheel
parent 59ef2ab0
...@@ -24,11 +24,13 @@ jobs: ...@@ -24,11 +24,13 @@ jobs:
PY_VERS: ${{ matrix.py_vers }} PY_VERS: ${{ matrix.py_vers }}
run: | run: |
. ~/miniconda3/etc/profile.d/conda.sh . ~/miniconda3/etc/profile.d/conda.sh
# Needed for JPEG library detection as setup.py detects conda presence by running `shlex.which('conda')`
export PATH=~/miniconda3/bin:$PATH
set -ex set -ex
. packaging/pkg_helpers.bash . packaging/pkg_helpers.bash
setup_build_version setup_build_version
WHL_NAME=torchvision-${BUILD_VERSION}-cp${PY_VERS/.}-cp${PY_VERS/.}-macosx_11_0_arm64.whl WHL_NAME=torchvision-${BUILD_VERSION}-cp${PY_VERS/.}-cp${PY_VERS/.}-macosx_11_0_arm64.whl
conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng openjpeg wheel pkg-config conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng "jpeg<=9b" wheel pkg-config
conda run -p ${ENV_NAME} python3 -mpip install torch --pre --extra-index-url=https://download.pytorch.org/whl/nightly conda run -p ${ENV_NAME} python3 -mpip install torch --pre --extra-index-url=https://download.pytorch.org/whl/nightly
conda run -p ${ENV_NAME} python3 -mpip install delocate conda run -p ${ENV_NAME} python3 -mpip install delocate
conda run -p ${ENV_NAME} python3 setup.py bdist_wheel conda run -p ${ENV_NAME} python3 setup.py bdist_wheel
...@@ -49,6 +51,7 @@ jobs: ...@@ -49,6 +51,7 @@ jobs:
# Test torch is importable, by changing cwd and running import commands # Test torch is importable, by changing cwd and running import commands
conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torchvision;print('torchvision version is ', torchvision.__version__)" conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torchvision;print('torchvision version is ', torchvision.__version__)"
conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torch;import torchvision;print('Is torchvision useable?', all(x is not None for x in [torch.ops.image.decode_png, torch.ops.torchvision.roi_align]))" conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torch;import torchvision;print('Is torchvision useable?', all(x is not None for x in [torch.ops.image.decode_png, torch.ops.torchvision.roi_align]))"
conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torchvision;print(torchvision.io.read_image('${PWD}/gallery/assets/dog1.jpg').shape)"
conda env remove -p ${ENV_NAME} conda env remove -p ${ENV_NAME}
- name: Upload wheel to GitHub - name: Upload wheel to GitHub
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment