Skip to content

Commit

Permalink
2024-07-08 nightly release (8f9d810)
Browse files Browse the repository at this point in the history
  • Loading branch information
pytorchbot committed Jul 8, 2024
1 parent 45890f6 commit 0b6972d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion references/classification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ torchrun --nproc_per_node=8 train.py\
--lr-scheduler=cosineannealinglr --lr-warmup-method=linear\
--lr-warmup-epochs=5 --lr-warmup-decay=0.1
```
Here `$MODEL` is one of `regnet_x_400mf`, `regnet_x_800mf`, `regnet_x_1_6gf`, `regnet_y_400mf`, `regnet_y_800mf` and `regnet_y_1_6gf`. Please note we used learning rate 0.4 for `regent_y_400mf` to get the same Acc@1 as [the paper)(https://arxiv.org/abs/2003.13678).
Here `$MODEL` is one of `regnet_x_400mf`, `regnet_x_800mf`, `regnet_x_1_6gf`, `regnet_y_400mf`, `regnet_y_800mf` and `regnet_y_1_6gf`. Please note we used learning rate 0.4 for `regent_y_400mf` to get the same Acc@1 as [the paper](https://arxiv.org/abs/2003.13678).

#### Medium models
```
Expand Down
10 changes: 9 additions & 1 deletion test/test_transforms_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,15 @@ def _check_transform_sample_input_smoke(transform, input, *, adapter):


def check_transform(transform, input, check_v1_compatibility=True, check_sample_input=True):
pickle.loads(pickle.dumps(transform))
# TODO: remove this cm once https://github.com/pytorch/vision/issues/8517
# and https://github.com/pytorch/pytorch/issues/130242 are resolved.
if isinstance(transform, (transforms.RandomResizedCrop, transforms.LinearTransformation)):
cm = pytest.warns(FutureWarning, match="You are using `torch.load`")
else:
cm = contextlib.nullcontext()

with cm:
pickle.loads(pickle.dumps(transform))

output = transform(input)
assert isinstance(output, type(input))
Expand Down
2 changes: 1 addition & 1 deletion torchvision/datasets/_optical_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, root: Union[str, Path], transforms: Optional[Callable] = None
def _read_img(self, file_name: str) -> Image.Image:
img = Image.open(file_name)
if img.mode != "RGB":
img = img.convert("RGB")
img = img.convert("RGB") # type: ignore[assignment]
return img

@abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion torchvision/datasets/_stereo_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self, root: Union[str, Path], transforms: Optional[Callable] = None
def _read_img(self, file_path: Union[str, Path]) -> Image.Image:
img = Image.open(file_path)
if img.mode != "RGB":
img = img.convert("RGB")
img = img.convert("RGB") # type: ignore [assignment]
return img

def _scan_pairs(
Expand Down
2 changes: 1 addition & 1 deletion torchvision/datasets/widerface.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __getitem__(self, index: int) -> Tuple[Any, Any]:
"""

# stay consistent with other datasets and return a PIL Image
img = Image.open(self.img_info[index]["img_path"])
img = Image.open(self.img_info[index]["img_path"]) # type: ignore[arg-type]

if self.transform is not None:
img = self.transform(img)
Expand Down
4 changes: 2 additions & 2 deletions torchvision/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ def _parse_colors(

colors = [ImageColor.getrgb(color) if isinstance(color, str) else color for color in colors]
if dtype.is_floating_point: # [0, 255] -> [0, 1]
colors = [tuple(v / 255 for v in color) for color in colors]
return colors
colors = [tuple(v / 255 for v in color) for color in colors] # type: ignore[union-attr]
return colors # type: ignore[return-value]


def _log_api_usage_once(obj: Any) -> None:
Expand Down

0 comments on commit 0b6972d

Please sign in to comment.