Skip to content

Commit 9eaed44

Browse files
jdsgomesfacebook-github-bot
authored andcommitted
[fbsync] [M1] Install "jpeg<=9b" rather than OpenJpeg (#6122)
Summary: 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 Reviewed By: NicolasHug Differential Revision: D36931836 fbshipit-source-id: d8a3bcc4f7ec513b95cd325e33bdf2aa695500e4
1 parent f634923 commit 9eaed44

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/build-m1-binaries.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ jobs:
2424
PY_VERS: ${{ matrix.py_vers }}
2525
run: |
2626
. ~/miniconda3/etc/profile.d/conda.sh
27+
# Needed for JPEG library detection as setup.py detects conda presence by running `shlex.which('conda')`
28+
export PATH=~/miniconda3/bin:$PATH
2729
set -ex
2830
. packaging/pkg_helpers.bash
2931
setup_build_version
3032
WHL_NAME=torchvision-${BUILD_VERSION}-cp${PY_VERS/.}-cp${PY_VERS/.}-macosx_11_0_arm64.whl
31-
conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng openjpeg wheel pkg-config
33+
conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng "jpeg<=9b" wheel pkg-config
3234
conda run -p ${ENV_NAME} python3 -mpip install torch --pre --extra-index-url=https://download.pytorch.org/whl/nightly
3335
conda run -p ${ENV_NAME} python3 -mpip install delocate
3436
conda run -p ${ENV_NAME} python3 setup.py bdist_wheel
@@ -49,6 +51,7 @@ jobs:
4951
# Test torch is importable, by changing cwd and running import commands
5052
conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torchvision;print('torchvision version is ', torchvision.__version__)"
5153
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]))"
54+
conda run --cwd /tmp -p ${ENV_NAME} python3 -c "import torchvision;print(torchvision.io.read_image('${PWD}/gallery/assets/dog1.jpg').shape)"
5255
conda env remove -p ${ENV_NAME}
5356
- name: Upload wheel to GitHub
5457
uses: actions/upload-artifact@v3

0 commit comments

Comments
 (0)