Skip to content

Commit 3007d16

Browse files
author
pytorchbot
committed
2025-08-08 nightly release (4a6ae15)
1 parent 7ac8061 commit 3007d16

File tree

6 files changed

+30
-24
lines changed

6 files changed

+30
-24
lines changed

.github/scripts/setup-env.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,8 @@ if [[ $GPU_ARCH_TYPE == 'cuda' ]]; then
8080
fi
8181
echo '::endgroup::'
8282

83-
echo '::group::Install third party dependencies prior to TorchVision install'
84-
# Installing with `easy_install`, e.g. `python setup.py install` or `python setup.py develop`, has some quirks when
85-
# when pulling in third-party dependencies. For example:
86-
# - On Windows, we often hit an SSL error although `pip` can install just fine.
87-
# - It happily pulls in pre-releases, which can lead to more problems down the line.
88-
# `pip` does not unless explicitly told to do so.
89-
# Thus, we use `easy_install` to extract the third-party dependencies here and install them upfront with `pip`.
90-
python setup.py egg_info
91-
# The requires.txt cannot be used with `pip install -r` directly. The requirements are listed at the top and the
92-
# optional dependencies come in non-standard syntax after a blank line. Thus, we just extract the header.
93-
sed -e '/^$/,$d' *.egg-info/requires.txt | tee requirements.txt
94-
pip install --progress-bar=off -r requirements.txt
95-
echo '::endgroup::'
96-
9783
echo '::group::Install TorchVision'
98-
python setup.py develop
84+
pip install -e . -v --no-build-isolation
9985
echo '::endgroup::'
10086

10187
echo '::group::Install torchvision-extra-decoders'

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ details.
5858
```bash
5959
git clone https://github.com/pytorch/vision.git
6060
cd vision
61-
python setup.py develop # use install instead of develop if you don't care about development.
61+
pip install -e . -v --no-build-isolation # leave out the -e switch if you don't care about development.
6262
# or, for OSX
63-
# MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py develop
63+
# MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ pip install -e . -v --no-build-isolation
6464
# for C++ debugging, use DEBUG=1
65-
# DEBUG=1 python setup.py develop
65+
# DEBUG=1 pip install -e . -v --no-build-isolation
6666
```
6767

6868
By default, GPU support is built if CUDA is found and `torch.cuda.is_available()` is true. It's possible to force

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Torchvision currently supports the following video backends:
7171

7272
```
7373
conda install -c conda-forge 'ffmpeg<4.3'
74-
python setup.py install
74+
pip install . -v --no-build-isolation
7575
```
7676

7777
# Using the models on C++

test/test_transforms_v2.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,14 +2520,29 @@ def test_errors(self):
25202520
with pytest.raises(TypeError, match="Argument transforms should be a sequence of callables"):
25212521
cls(lambda x: x)
25222522

2523-
with pytest.raises(ValueError, match="at least one transform"):
2524-
transforms.Compose([])
2523+
for cls in (
2524+
transforms.Compose,
2525+
transforms.RandomApply,
2526+
transforms.RandomChoice,
2527+
transforms.RandomOrder,
2528+
):
2529+
2530+
with pytest.raises(ValueError, match="at least one transform"):
2531+
cls([])
25252532

25262533
for p in [-1, 2]:
25272534
with pytest.raises(ValueError, match=re.escape("value in the interval [0.0, 1.0]")):
25282535
transforms.RandomApply([lambda x: x], p=p)
25292536

2530-
for transforms_, p in [([lambda x: x], []), ([], [1.0])]:
2537+
for transforms_, p in [
2538+
([lambda x: x], []),
2539+
(
2540+
[lambda x: x, lambda x: x],
2541+
[
2542+
1.0,
2543+
],
2544+
),
2545+
]:
25312546
with pytest.raises(ValueError, match="Length of p doesn't match the number of transforms"):
25322547
transforms.RandomChoice(transforms_, p=p)
25332548

torchvision/csrc/io/decoder/gpu/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ GPU decoder depends on ffmpeg for demuxing, uses NVDECODE APIs from the nvidia-v
1818

1919
.. code:: bash
2020
21-
python setup.py install
21+
pip install . -v --no-build-isolation

torchvision/transforms/v2/_container.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ def __init__(self, transforms: Union[Sequence[Callable], nn.ModuleList], p: floa
8787

8888
if not isinstance(transforms, (Sequence, nn.ModuleList)):
8989
raise TypeError("Argument transforms should be a sequence of callables or a `nn.ModuleList`")
90+
elif not transforms:
91+
raise ValueError("Pass at least one transform")
9092
self.transforms = transforms
9193

9294
if not (0.0 <= p <= 1.0):
@@ -133,7 +135,8 @@ def __init__(
133135
) -> None:
134136
if not isinstance(transforms, Sequence):
135137
raise TypeError("Argument transforms should be a sequence of callables")
136-
138+
elif not transforms:
139+
raise ValueError("Pass at least one transform")
137140
if p is None:
138141
p = [1] * len(transforms)
139142
elif len(p) != len(transforms):
@@ -163,6 +166,8 @@ class RandomOrder(Transform):
163166
def __init__(self, transforms: Sequence[Callable]) -> None:
164167
if not isinstance(transforms, Sequence):
165168
raise TypeError("Argument transforms should be a sequence of callables")
169+
elif not transforms:
170+
raise ValueError("Pass at least one transform")
166171
super().__init__()
167172
self.transforms = transforms
168173

0 commit comments

Comments
 (0)