Skip to content

Commit f59df35

Browse files
committed
some more
1 parent 5cf7f15 commit f59df35

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

torchvision/prototype/models/detection/faster_rcnn.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ def fasterrcnn_mobilenet_v3_large_320_fpn(
203203
) -> FasterRCNN:
204204
if "pretrained" in kwargs:
205205
warnings.warn("The argument pretrained is deprecated, please use weights instead.")
206+
# These long weight names are a bit of a mouthful lol
207+
# I don't have a better proposal TBH.
208+
# I think the complexity of those weight names can be greatly reduced by:
209+
# - good docs (which I know is part of the future work)
210+
# - good defaults like "pretrained" or "latest" or whatever is easy to remember for the user, as suggested in another comment
206211
weights = FasterRCNNMobileNetV3Large320FPNWeights.Coco_RefV1 if kwargs.pop("pretrained") else None
207212
weights = FasterRCNNMobileNetV3Large320FPNWeights.verify(weights)
208213
if "pretrained_backbone" in kwargs:

torchvision/prototype/models/resnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def resnet18(weights: Optional[ResNet18Weights] = None, progress: bool = True, *
248248
# This would make sure the warning message is consistent, avoid code duplication, etc.
249249
if "pretrained" in kwargs:
250250
# Nit: "argument" should probably be "parameter", since the term
251-
# "argument" refers to the _value_ of the parameter at call time.
251+
# "argument" refers to the *value* of the parameter at call time.
252252
warnings.warn("The 'pretrained' parameter is deprecated, please use the 'weights' parameter instead.")
253253
weights = ResNet18Weights.ImageNet1K_RefV1 if kwargs.pop("pretrained") else None
254254

0 commit comments

Comments
 (0)