Skip to content

Commit 738bb42

Browse files
committed
Merge branch 'v0.5.1' of github.com:pytorch/vision into build/v0.5.1
2 parents 65b6ed1 + e61538c commit 738bb42

Some content is hidden

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

65 files changed

+522
-570
lines changed

.circleci/config.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,27 @@ jobs:
7676
python .circleci/regenerate.py
7777
git diff --exit-code || (echo ".circleci/config.yml not in sync with config.yml.in! Run .circleci/regenerate.py to update config"; exit 1)
7878
79+
python_lint:
80+
docker:
81+
- image: circleci/python:3.7
82+
steps:
83+
- checkout
84+
- run:
85+
command: |
86+
pip install --user --progress-bar off flake8 typing
87+
flake8 .
88+
89+
clang_format:
90+
docker:
91+
- image: circleci/python:3.7
92+
steps:
93+
- checkout
94+
- run:
95+
command: |
96+
sudo apt-get update -y
97+
sudo apt-get install -y clang-format
98+
./travis-scripts/run-clang-format/run-clang-format.py -r torchvision/csrc
99+
79100
binary_linux_wheel:
80101
<<: *binary_common
81102
docker:
@@ -152,7 +173,7 @@ jobs:
152173
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit=${NVIDIA_CONTAINER_VERSION}
153174
sudo systemctl restart docker
154175
155-
DRIVER_FN="NVIDIA-Linux-x86_64-410.104.run"
176+
DRIVER_FN="NVIDIA-Linux-x86_64-440.59.run"
156177
wget "https://s3.amazonaws.com/ossci-linux/nvidia_driver/$DRIVER_FN"
157178
sudo /bin/bash "$DRIVER_FN" -s --no-drm || (sudo cat /var/log/nvidia-installer.log && false)
158179
nvidia-smi
@@ -497,6 +518,10 @@ workflows:
497518
name: binary_macos_conda_py3.8_cpu
498519
python_version: '3.8'
499520
wheel_docker_image: pytorch/manylinux-cuda102
521+
- binary_linux_conda_cuda:
522+
name: torchvision_linux_py3.8_cu102_cuda
523+
python_version: "3.8"
524+
cu_version: "cu102"
500525
- binary_win_conda:
501526
name: torchvision_win_py3.6_cpu
502527
python_version: "3.6"
@@ -505,10 +530,14 @@ workflows:
505530
name: torchvision_win_py3.6_cu101
506531
python_version: "3.6"
507532
cu_version: "cu101"
533+
- python_lint
534+
- clang_format
508535

509536
nightly:
510537
jobs:
511538
- circleci_consistency
539+
- python_lint
540+
- clang_format
512541
- binary_linux_wheel:
513542
cu_version: cpu
514543
filters:

.circleci/config.yml.in

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,27 @@ jobs:
7676
python .circleci/regenerate.py
7777
git diff --exit-code || (echo ".circleci/config.yml not in sync with config.yml.in! Run .circleci/regenerate.py to update config"; exit 1)
7878

79+
python_lint:
80+
docker:
81+
- image: circleci/python:3.7
82+
steps:
83+
- checkout
84+
- run:
85+
command: |
86+
pip install --user --progress-bar off flake8 typing
87+
flake8 .
88+
89+
clang_format:
90+
docker:
91+
- image: circleci/python:3.7
92+
steps:
93+
- checkout
94+
- run:
95+
command: |
96+
sudo apt-get update -y
97+
sudo apt-get install -y clang-format
98+
./travis-scripts/run-clang-format/run-clang-format.py -r torchvision/csrc
99+
79100
binary_linux_wheel:
80101
<<: *binary_common
81102
docker:
@@ -152,7 +173,7 @@ jobs:
152173
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit=${NVIDIA_CONTAINER_VERSION}
153174
sudo systemctl restart docker
154175

155-
DRIVER_FN="NVIDIA-Linux-x86_64-410.104.run"
176+
DRIVER_FN="NVIDIA-Linux-x86_64-440.59.run"
156177
wget "https://s3.amazonaws.com/ossci-linux/nvidia_driver/$DRIVER_FN"
157178
sudo /bin/bash "$DRIVER_FN" -s --no-drm || (sudo cat /var/log/nvidia-installer.log && false)
158179
nvidia-smi
@@ -299,6 +320,10 @@ workflows:
299320
jobs:
300321
- circleci_consistency
301322
{{ workflows() }}
323+
- binary_linux_conda_cuda:
324+
name: torchvision_linux_py3.8_cu102_cuda
325+
python_version: "3.8"
326+
cu_version: "cu102"
302327
- binary_win_conda:
303328
name: torchvision_win_py3.6_cpu
304329
python_version: "3.6"
@@ -307,9 +332,13 @@ workflows:
307332
name: torchvision_win_py3.6_cu101
308333
python_version: "3.6"
309334
cu_version: "cu101"
335+
- python_lint
336+
- clang_format
310337

311338
nightly:
312339
{%- endif %}
313340
jobs:
314341
- circleci_consistency
342+
- python_lint
343+
- clang_format
315344
{{ workflows(prefix="nightly_", filter_branch="nightly", upload=True) }}

.travis.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,6 @@ language: python
33
dist: xenial
44
matrix:
55
include:
6-
- env: FORMAT_CHECK
7-
language: cpp
8-
addons:
9-
apt:
10-
sources:
11-
- llvm-toolchain-xenial-7
12-
packages:
13-
- clang-7
14-
- clang-format-7
15-
before_install: skip
16-
install: skip
17-
script: ./travis-scripts/run-clang-format/run-clang-format.py -r torchvision/csrc
18-
- env: LINT_CHECK
19-
python: "3.6"
20-
install: pip install flake8 typing
21-
script: flake8 .circleci
22-
after_success: []
236
- python: "3.6"
247
env: IMAGE_BACKEND=Pillow-SIMD
258
- python: "3.6"

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
sphinx==1.7.3
22
sphinxcontrib-googleanalytics
3-
-e git://github.com/snide/sphinx_rtd_theme.git#egg=sphinx_rtd_theme
3+
-e git+git://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme

docs/source/conf.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# sys.path.insert(0, os.path.abspath('.'))
2323
import torch
2424
import torchvision
25-
import sphinx_rtd_theme
25+
import pytorch_sphinx_theme
2626

2727

2828
# -- General configuration ------------------------------------------------
@@ -104,8 +104,8 @@
104104
# The theme to use for HTML and HTML Help pages. See the documentation for
105105
# a list of builtin themes.
106106
#
107-
html_theme = 'sphinx_rtd_theme'
108-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
107+
html_theme = 'pytorch_sphinx_theme'
108+
html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]
109109

110110
# Theme options are theme-specific and customize the look and feel of a theme
111111
# further. For a list of options available for each theme, see the
@@ -115,6 +115,7 @@
115115
'collapse_navigation': False,
116116
'display_version': True,
117117
'logo_only': True,
118+
'pytorch_project': 'docs',
118119
}
119120

120121
html_logo = '_static/img/pytorch-logo-dark.svg'
@@ -125,12 +126,12 @@
125126
html_static_path = ['_static']
126127

127128
# html_style_path = 'css/pytorch_theme.css'
128-
html_context = {
129-
'css_files': [
130-
'https://fonts.googleapis.com/css?family=Lato',
131-
'_static/css/pytorch_theme.css'
132-
],
133-
}
129+
# html_context = {
130+
# 'css_files': [
131+
# 'https://fonts.googleapis.com/css?family=Lato',
132+
# '_static/css/pytorch_theme.css'
133+
# ],
134+
# }
134135

135136

136137
# -- Options for HTMLHelp output ------------------------------------------

docs/source/models.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,28 @@ You can use the following transform to normalize::
8686
An example of such normalization can be found in the imagenet example
8787
`here <https://github.com/pytorch/examples/blob/42e5b996718797e45c46a25c55b031e6768f8440/imagenet/main.py#L89-L101>`_
8888

89+
The process for obtaining the values of `mean` and `std` is roughly equivalent
90+
to::
91+
92+
import torch
93+
from torchvision import datasets, transforms as T
94+
95+
transform = T.Compose([T.Resize(256), T.CenterCrop(224), T.ToTensor()])
96+
dataset = datasets.ImageNet(".", split="train", transform=transform)
97+
98+
means = []
99+
stds = []
100+
for img in subset(dataset):
101+
means.append(torch.mean(img))
102+
stds.append(torch.std(img))
103+
104+
mean = torch.mean(torch.tensor(means))
105+
std = torch.mean(torch.tensor(stds))
106+
107+
Unfortunately, the concret `subset` that was used is lost. For more
108+
information see `this discussion <https://github.com/pytorch/vision/issues/1439>`_
109+
or `these experiments <https://github.com/pytorch/vision/pull/1965>`_.
110+
89111
ImageNet 1-crop error rates (224x224)
90112

91113
================================ ============= =============

packaging/torchvision/meta.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ requirements:
2020
- python
2121
- pillow >=4.1.1
2222
- numpy >=1.11
23-
- six
2423
{{ environ.get('CONDA_PYTORCH_CONSTRAINT') }}
2524
{{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT') }}
2625

packaging/windows/internal/cuda_install.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ if not exist "%SRC_DIR%\temp_build\NvToolsExt.7z" (
9696
if errorlevel 1 exit /b 1
9797
)
9898

99+
if not exist "%SRC_DIR%\temp_build\gpu_driver_dlls.7z" (
100+
curl -k -L "https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output "%SRC_DIR%\temp_build\gpu_driver_dlls.zip"
101+
if errorlevel 1 exit /b 1
102+
)
103+
99104
echo Installing CUDA toolkit...
100105
7z x %CUDA_SETUP_FILE% -o"%SRC_DIR%\temp_build\cuda"
101106
pushd "%SRC_DIR%\temp_build\cuda"
@@ -131,5 +136,8 @@ xcopy /Y "%SRC_DIR%\temp_build\cudnn\cuda\bin\*.*" "%ProgramFiles%\NVIDIA GPU Co
131136
xcopy /Y "%SRC_DIR%\temp_build\cudnn\cuda\lib\x64\*.*" "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%\lib\x64"
132137
xcopy /Y "%SRC_DIR%\temp_build\cudnn\cuda\include\*.*" "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%\include"
133138

139+
echo Installing GPU driver DLLs
140+
7z x %SRC_DIR%\temp_build\gpu_driver_dlls.zip -o"C:\Windows\System32"
141+
134142
echo Cleaning temp files
135143
rd /s /q "%SRC_DIR%\temp_build" || ver > nul

references/classification/train.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
from __future__ import print_function
21
import datetime
32
import os
43
import time
5-
import sys
64

75
import torch
86
import torch.utils.data
@@ -141,12 +139,9 @@ def load_data(traindir, valdir, cache_dataset, distributed):
141139

142140

143141
def main(args):
144-
if args.apex:
145-
if sys.version_info < (3, 0):
146-
raise RuntimeError("Apex currently only supports Python 3. Aborting.")
147-
if amp is None:
148-
raise RuntimeError("Failed to import apex. Please install apex from https://www.github.com/nvidia/apex "
149-
"to enable mixed-precision training.")
142+
if args.apex and amp is None:
143+
raise RuntimeError("Failed to import apex. Please install apex from https://www.github.com/nvidia/apex "
144+
"to enable mixed-precision training.")
150145

151146
if args.output_dir:
152147
utils.mkdir(args.output_dir)

references/classification/train_quantization.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import datetime
32
import os
43
import time

0 commit comments

Comments
 (0)