-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wheel relocation issues #2777
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2777 +/- ##
==========================================
- Coverage 73.31% 73.22% -0.09%
==========================================
Files 99 96 -3
Lines 8724 8446 -278
Branches 1373 1320 -53
==========================================
- Hits 6396 6185 -211
+ Misses 1909 1859 -50
+ Partials 419 402 -17
Continue to review full report at Codecov.
|
I have bad news here, we need to compile FFmpeg from scratch on the manylinux image in order to have manylinux wheel compatibility |
Ok. I propose that we first fix the issues with libjpeg / libpng, merge this, and then fix ffmpeg in a follow-up PR |
We need to compile libPNG ourselves as well |
My solution on this case would be the following:
This seems relevant: https://github.com/njsmith/machomachomangler |
I tried to rename |
PyAV is not a hard dependency, right ? For windows, we can put "experimentatl" mention in the docs, put try/catch while it is imported and include a detailed instruction on what to do instead. |
My take on this: let's separate this into two PRs: one with only libjpeg / libpng, and one with FFmpeg. This way we can start merging the libjpeg / libpng bits and testing it, while we iterate on FFmpeg. EDIT: I'm instead disabling FFmpeg on Windows in this PR to move forward, and we fix the rest in a follow-up PR |
Test failures are unrelated, merging this to unblock. We should still fix FFmpeg on Windows and Linux |
Manual tests:
#!/bin/bash
python -m pip uninstall -y torchvision
python -m pip uninstall -y torch
conda uninstall -y torchvision
conda uninstall -y pytorch
python -m pip install --pre --upgrade torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
python -m pip list | grep torch
pip install opencv-python
#!/bin/bash
pip uninstall -y torchvision
pip uninstall -y torch
conda uninstall -y torchvision
conda uninstall -y pytorch
conda install -y pytorch torchvision -c pytorch-nightly
conda list | grep torch
pip install opencv-python
import cv2
from PIL import Image
import torch, torchvision
from torchvision.io.image import read_image
print("torch.ops.load_library(torchvision.io.image.ext_specs.origin):",
torch.ops.load_library(torchvision.io.image.ext_specs.origin))
im1 = cv2.imread("test-image.jpg")
print("Opencv:", im1.shape, im1.dtype)
im2 = Image.open("test-image.jpg")
print("PIL:", im2.size, im2.mode)
tensor_image = read_image("test-image.jpg")
print("tensor image info: ", tensor_image.shape, tensor_image.dtype) |
Awesome, thanks a lot for checking this @vfdev-5 ! |
* [DEBUG] Check wheel relocation issues * Call delocate on Mac * Use yum instead of conda * Do not copy ffmpeg dylibs * Linux dry run * Do not download FFmpeg on Mac * Install bzip2 * Restore FFmpeg on Windows * Remove ffmpeg temporarily * Do not remove dependencies * Disable FFmpeg temporarily on Linux wheels * Test relocation in Linux * Add docstring * Call relocation script * Minor error correction * Import auditwheel only on Linux * Restore ffmpeg again on Windows * Return *device * Try fix Windows * Fix clang-format * Start windows patchwork * Copy all DLLs * Disable FFmpeg on Windows for now * Bugfix Co-authored-by: Francisco Massa <fvsmassa@gmail.com>
* [DEBUG] Check wheel relocation issues * Call delocate on Mac * Use yum instead of conda * Do not copy ffmpeg dylibs * Linux dry run * Do not download FFmpeg on Mac * Install bzip2 * Restore FFmpeg on Windows * Remove ffmpeg temporarily * Do not remove dependencies * Disable FFmpeg temporarily on Linux wheels * Test relocation in Linux * Add docstring * Call relocation script * Minor error correction * Import auditwheel only on Linux * Restore ffmpeg again on Windows * Return *device * Try fix Windows * Fix clang-format * Start windows patchwork * Copy all DLLs * Disable FFmpeg on Windows for now * Bugfix Co-authored-by: Francisco Massa <fvsmassa@gmail.com>
* [DEBUG] Check wheel relocation issues * Call delocate on Mac * Use yum instead of conda * Do not copy ffmpeg dylibs * Linux dry run * Do not download FFmpeg on Mac * Install bzip2 * Restore FFmpeg on Windows * Remove ffmpeg temporarily * Do not remove dependencies * Disable FFmpeg temporarily on Linux wheels * Test relocation in Linux * Add docstring * Call relocation script * Minor error correction * Import auditwheel only on Linux * Restore ffmpeg again on Windows * Return *device * Try fix Windows * Fix clang-format * Start windows patchwork * Copy all DLLs * Disable FFmpeg on Windows for now * Bugfix Co-authored-by: Francisco Massa <fvsmassa@gmail.com>
No description provided.