Unverified Commit 4bf60863 authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

add torchdata as prototype dependency (#4499)



* add torchdata as prototype dependency

* ignore torchdata for mypy

* move git dependency out of conda environment file

* try unsetting PYTORCH_VERSION env var

* cleanup

* move installation of torchdata after installtion of PyTorch

* regenerate circlci config

* remove branch from torchdata download link
Co-authored-by: default avatarFrancisco Massa <fvsmassa@gmail.com>
parent f7498350
...@@ -200,6 +200,7 @@ jobs: ...@@ -200,6 +200,7 @@ jobs:
pip install --user --progress-bar off mypy pip install --user --progress-bar off mypy
pip install --user --progress-bar off types-requests pip install --user --progress-bar off types-requests
pip install --user --progress-bar off --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html pip install --user --progress-bar off --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
pip install --user --progress-bar off git+https://github.com/pytorch/data.git
pip install --user --progress-bar off --editable . pip install --user --progress-bar off --editable .
mypy --config-file mypy.ini mypy --config-file mypy.ini
......
...@@ -200,6 +200,7 @@ jobs: ...@@ -200,6 +200,7 @@ jobs:
pip install --user --progress-bar off mypy pip install --user --progress-bar off mypy
pip install --user --progress-bar off types-requests pip install --user --progress-bar off types-requests
pip install --user --progress-bar off --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html pip install --user --progress-bar off --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
pip install --user --progress-bar off git+https://github.com/pytorch/data.git
pip install --user --progress-bar off --editable . pip install --user --progress-bar off --editable .
mypy --config-file mypy.ini mypy --config-file mypy.ini
......
...@@ -26,6 +26,10 @@ fi ...@@ -26,6 +26,10 @@ fi
printf "Installing PyTorch with %s\n" "${cudatoolkit}" printf "Installing PyTorch with %s\n" "${cudatoolkit}"
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest
printf "Installing torchdata from source"
pip install git+https://github.com/pytorch/data.git
if [ $PYTHON_VERSION == "3.6" ]; then if [ $PYTHON_VERSION == "3.6" ]; then
printf "Installing minimal PILLOW version\n" printf "Installing minimal PILLOW version\n"
# Install the minimal PILLOW version. Otherwise, let setup.py install the latest # Install the minimal PILLOW version. Otherwise, let setup.py install the latest
......
...@@ -29,6 +29,10 @@ printf "Installing PyTorch with %s\n" "${cudatoolkit}" ...@@ -29,6 +29,10 @@ printf "Installing PyTorch with %s\n" "${cudatoolkit}"
# conda-forge channel is required for cudatoolkit 11.1 on Windows, see https://github.com/pytorch/vision/issues/4458 # conda-forge channel is required for cudatoolkit 11.1 on Windows, see https://github.com/pytorch/vision/issues/4458
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c conda-forge "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c conda-forge "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest
printf "Installing torchdata from source"
pip install git+https://github.com/pytorch/data.git
if [ $PYTHON_VERSION == "3.6" ]; then if [ $PYTHON_VERSION == "3.6" ]; then
printf "Installing minimal PILLOW version\n" printf "Installing minimal PILLOW version\n"
# Install the minimal PILLOW version. Otherwise, let setup.py install the latest # Install the minimal PILLOW version. Otherwise, let setup.py install the latest
......
...@@ -67,3 +67,7 @@ ignore_missing_imports = True ...@@ -67,3 +67,7 @@ ignore_missing_imports = True
[mypy-defusedxml.*] [mypy-defusedxml.*]
ignore_missing_imports = True ignore_missing_imports = True
[mypy-torchdata.*]
ignore_missing_imports = True
try:
import torchdata
except (ModuleNotFoundError, TypeError) as error:
raise ModuleNotFoundError(
"`torchvision.prototype.datasets` depends on PyTorch's `torchdata` (https://github.com/pytorch/data). "
"You can install it with `pip install git+https://github.com/pytorch/data.git`. "
"Note that you cannot install it with `pip install torchdata`, since this is another package."
) from error
from ._home import home from ._home import home
from . import decoder, utils from . import decoder, utils
......
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