Skip to content

Commit e7e921e

Browse files
committed
Merge branch 'main'
Conflicts: test/builtin_dataset_mocks.py test/test_prototype_builtin_datasets.py torchvision/prototype/datasets/_builtin/imagenet.py torchvision/prototype/datasets/utils/_dataset.py
2 parents d5c3a43 + 1db8795 commit e7e921e

File tree

239 files changed

+7451
-7993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+7451
-7993
lines changed

.circleci/config.yml

Lines changed: 45 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.circleci/config.yml.in

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ commands:
146146
default: true
147147
steps:
148148
- pip_install:
149-
args: --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
149+
args: --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu
150150
descr: Install PyTorch from nightly releases
151151
- pip_install:
152152
args: --no-build-isolation <<# parameters.editable >> --editable <</ parameters.editable >> .
@@ -155,8 +155,11 @@ commands:
155155
install_prototype_dependencies:
156156
steps:
157157
- pip_install:
158-
args: iopath git+https://github.com/pytorch/data
159-
descr: Install prototype dependencies
158+
args: iopath
159+
descr: Install third-party dependencies
160+
- pip_install:
161+
args: --pre torchdata --extra-index-url https://download.pytorch.org/whl/nightly/cpu
162+
descr: Install torchdata from nightly releases
160163

161164
# Most of the test suite is handled by the `unittest` jobs, with completely different workflow and setup.
162165
# This command can be used if only a selection of tests need to be run, for ad-hoc files.
@@ -174,6 +177,26 @@ commands:
174177
- store_test_results:
175178
path: test-results
176179

180+
download_model_weights:
181+
parameters:
182+
extract_roots:
183+
type: string
184+
default: "torchvision/models"
185+
background:
186+
type: boolean
187+
default: true
188+
steps:
189+
- apt_install:
190+
args: parallel wget
191+
descr: Install download utilitites
192+
- run:
193+
name: Download model weights
194+
background: << parameters.background >>
195+
command: |
196+
mkdir -p ~/.cache/torch/hub/checkpoints
197+
python scripts/collect_model_urls.py << parameters.extract_roots >> \
198+
| parallel -j0 'wget --no-verbose -O ~/.cache/torch/hub/checkpoints/`basename {}` {}\?source=ci'
199+
177200
binary_common: &binary_common
178201
parameters:
179202
# Edit these defaults to do a release
@@ -340,25 +363,28 @@ jobs:
340363
resource_class: xlarge
341364
steps:
342365
- checkout
343-
- run:
344-
name: Download model weights
345-
background: true
346-
command: |
347-
sudo apt update -qy && sudo apt install -qy parallel wget
348-
mkdir -p ~/.cache/torch/hub/checkpoints
349-
python scripts/collect_model_urls.py torchvision/prototype/models \
350-
| parallel -j0 'wget --no-verbose -O ~/.cache/torch/hub/checkpoints/`basename {}` {}\?source=ci'
351366
- install_torchvision
352367
- install_prototype_dependencies
353368
- pip_install:
354369
args: scipy pycocotools h5py
355370
descr: Install optional dependencies
356-
- run:
357-
name: Enable prototype tests
358-
command: echo 'export PYTORCH_TEST_WITH_PROTOTYPE=1' >> $BASH_ENV
359371
- run_tests_selective:
360372
file_or_dir: test/test_prototype_*.py
361373

374+
unittest_extended:
375+
docker:
376+
- image: circleci/python:3.7
377+
resource_class: xlarge
378+
steps:
379+
- checkout
380+
- download_model_weights
381+
- install_torchvision
382+
- run:
383+
name: Enable extended tests
384+
command: echo 'export PYTORCH_TEST_WITH_EXTENDED=1' >> $BASH_ENV
385+
- run_tests_selective:
386+
file_or_dir: test/test_extended_*.py
387+
362388
binary_linux_wheel:
363389
<<: *binary_common
364390
docker:
@@ -1011,12 +1037,13 @@ jobs:
10111037
build_docs:
10121038
<<: *binary_common
10131039
docker:
1014-
- image: "pytorch/manylinux-cuda100"
1040+
- image: circleci/python:3.7
10151041
resource_class: 2xlarge+
10161042
steps:
10171043
- attach_workspace:
10181044
at: ~/workspace
10191045
- checkout
1046+
- download_model_weights
10201047
- run:
10211048
name: Setup
10221049
command: .circleci/unittest/linux/scripts/setup_env.sh
@@ -1069,7 +1096,8 @@ jobs:
10691096
# Don't use "checkout" step since it uses ssh, which cannot git push
10701097
# https://circleci.com/docs/2.0/configuration-reference/#checkout
10711098
set -ex
1072-
tag=${CIRCLE_TAG:1:5}
1099+
# Change v1.12.1rc1 into 1.12 (only major.minor)
1100+
tag=$(echo $CIRCLE_TAG | sed -e 's/v*\([0-9]*\.[0-9]*\).*/\1/')
10731101
target=${tag:-main}
10741102
~/workspace/.circleci/build_docs/commit_docs.sh ~/workspace $target
10751103

@@ -1093,6 +1121,7 @@ workflows:
10931121
- unittest_torchhub
10941122
- unittest_onnx
10951123
- unittest_prototype
1124+
- unittest_extended
10961125
{{ unittest_workflows() }}
10971126

10981127
cmake:

.circleci/unittest/linux/scripts/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ else
2121
fi
2222
echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION"
2323
version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")"
24-
cudatoolkit="cudatoolkit=${version}"
24+
cudatoolkit="nvidia::cudatoolkit=${version}"
2525
fi
2626

2727
case "$(uname -s)" in
@@ -33,7 +33,7 @@ printf "Installing PyTorch with %s\n" "${cudatoolkit}"
3333
if [ "${os}" == "MacOSX" ]; then
3434
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest
3535
else
36-
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" pytest
36+
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c nvidia "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}" pytest
3737
fi
3838

3939
printf "* Installing torchvision\n"

.circleci/unittest/linux/scripts/run_test.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ set -e
55
eval "$(./conda/bin/conda shell.bash hook)"
66
conda activate ./env
77

8-
export PYTORCH_TEST_WITH_SLOW='1'
98
python -m torch.utils.collect_env
109
pytest --junitxml=test-results/junit.xml -v --durations 20

.circleci/unittest/windows/scripts/run_test.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ conda activate ./env
88
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
99
source "$this_dir/set_cuda_envs.sh"
1010

11-
export PYTORCH_TEST_WITH_SLOW='1'
1211
python -m torch.utils.collect_env
1312
pytest --junitxml=test-results/junit.xml -v --durations 20

.git-blame-ignore-revs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file keeps git blame clean.
2+
# See https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view
3+
4+
# Add ufmt (usort + black) as code formatter (#4384)
5+
5f0edb97b46e5bff71dc19dedef05c5396eeaea2
6+
# update python syntax >=3.6 (#4585)
7+
d367a01a18a3ae6bee13d8be3b63fd6a581ea46f

README.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ supported Python versions.
2121
+--------------------------+--------------------------+---------------------------------+
2222
| ``torch`` | ``torchvision`` | ``python`` |
2323
+==========================+==========================+=================================+
24-
| ``main`` / ``nightly`` | ``main`` / ``nightly`` | ``>=3.7``, ``<=3.9`` |
24+
| ``main`` / ``nightly`` | ``main`` / ``nightly`` | ``>=3.7``, ``<=3.10`` |
25+
+--------------------------+--------------------------+---------------------------------+
26+
| ``1.11.0`` | ``0.12.0`` | ``>=3.7``, ``<=3.10`` |
2527
+--------------------------+--------------------------+---------------------------------+
2628
| ``1.10.2`` | ``0.11.3`` | ``>=3.6``, ``<=3.9`` |
2729
+--------------------------+--------------------------+---------------------------------+

android/test_app/make_assets.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import torch
2-
import torchvision
32
from torch.utils.mobile_optimizer import optimize_for_mobile
3+
from torchvision.models.detection import (
4+
fasterrcnn_mobilenet_v3_large_320_fpn,
5+
FasterRCNN_MobileNet_V3_Large_320_FPN_Weights,
6+
)
47

58
print(torch.__version__)
69

7-
model = torchvision.models.detection.fasterrcnn_mobilenet_v3_large_320_fpn(
8-
pretrained=True, box_score_thresh=0.7, rpn_post_nms_top_n_test=100, rpn_score_thresh=0.4, rpn_pre_nms_top_n_test=150
10+
model = fasterrcnn_mobilenet_v3_large_320_fpn(
11+
weights=FasterRCNN_MobileNet_V3_Large_320_FPN_Weights.DEFAULT,
12+
box_score_thresh=0.7,
13+
rpn_post_nms_top_n_test=100,
14+
rpn_score_thresh=0.4,
15+
rpn_pre_nms_top_n_test=150,
916
)
1017

1118
model.eval()

docs/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ numpy
33
sphinx-copybutton>=0.3.1
44
sphinx-gallery>=0.9.0
55
sphinx==3.5.4
6+
# This pin is only needed for sphinx<4.0.2. See https://github.com/pytorch/vision/issues/5673 for details
7+
Jinja2<3.1.*
68
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme

docs/source/conf.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
# import sys
2121
# sys.path.insert(0, os.path.abspath('.'))
2222

23+
import os
24+
2325
import pytorch_sphinx_theme
2426
import torchvision
2527

@@ -80,11 +82,16 @@
8082
# built documents.
8183
#
8284
# The short X.Y version.
83-
# TODO: change to [:2] at v1.0
8485
version = "main (" + torchvision.__version__ + " )"
8586
# The full version, including alpha/beta/rc tags.
86-
# TODO: verify this works as expected
8787
release = "main"
88+
VERSION = os.environ.get("VERSION", None)
89+
if VERSION:
90+
# Turn 1.11.0aHASH into 1.11 (major.minor only)
91+
version = ".".join(version.split(".")[:2])
92+
html_title = " ".join((project, version, "documentation"))
93+
release = version
94+
8895

8996
# The language for content autogenerated by Sphinx. Refer to documentation
9097
# for a list of supported languages.

0 commit comments

Comments
 (0)