Skip to content

Commit 394aa03

Browse files
committed
Update error messages
1 parent 5159011 commit 394aa03

File tree

12 files changed

+12
-12
lines changed

12 files changed

+12
-12
lines changed

torchvision/models/convnext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def _convnext(
197197
model = ConvNeXt(block_setting, stochastic_depth_prob=stochastic_depth_prob, **kwargs)
198198
if pretrained:
199199
if arch not in _MODELS_URLS:
200-
raise NotImplementedError(f"No checkpoint is available for model type {arch}")
200+
raise NotImplementedError(f"No pre-trained weights are available for model type {arch}")
201201
state_dict = load_state_dict_from_url(_MODELS_URLS[arch], progress=progress)
202202
model.load_state_dict(state_dict)
203203
return model

torchvision/models/detection/faster_rcnn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def _fasterrcnn_mobilenet_v3_large_fpn(
436436
)
437437
if pretrained:
438438
if model_urls.get(arch, None) is None:
439-
raise NotImplementedError(f"No checkpoint is available for model type {arch}")
439+
raise NotImplementedError(f"No pre-trained weights are available for model type {arch}")
440440
state_dict = load_state_dict_from_url(model_urls[arch], progress=progress)
441441
model.load_state_dict(state_dict)
442442
return model

torchvision/models/detection/ssd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ def ssd300_vgg16(
624624
if pretrained:
625625
arch = "ssd300_vgg16_coco"
626626
if model_urls.get(arch, None) is None:
627-
raise NotImplementedError(f"No checkpoint is available for model type {arch}")
627+
raise NotImplementedError(f"No pre-trained weights are available for model type {arch}")
628628
state_dict = load_state_dict_from_url(model_urls[arch], progress=progress)
629629
model.load_state_dict(state_dict)
630630
return model

torchvision/models/detection/ssdlite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def ssdlite320_mobilenet_v3_large(
269269
if pretrained:
270270
arch = "ssdlite320_mobilenet_v3_large_coco"
271271
if model_urls.get(arch, None) is None:
272-
raise NotImplementedError(f"No checkpoint is available for model type {arch}")
272+
raise NotImplementedError(f"No pre-trained weights are available for model type {arch}")
273273
state_dict = load_state_dict_from_url(model_urls[arch], progress=progress)
274274
model.load_state_dict(state_dict)
275275
return model

torchvision/models/efficientnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def _efficientnet(
373373
model = EfficientNet(inverted_residual_setting, dropout, last_channel=last_channel, **kwargs)
374374
if pretrained:
375375
if model_urls.get(arch, None) is None:
376-
raise NotImplementedError(f"No checkpoint is available for model type {arch}")
376+
raise NotImplementedError(f"No pre-trained weights are available for model type {arch}")
377377
state_dict = load_state_dict_from_url(model_urls[arch], progress=progress)
378378
model.load_state_dict(state_dict)
379379
return model

torchvision/models/mnasnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def _load_from_state_dict(
198198

199199
def _load_pretrained(arch: str, model: nn.Module, progress: bool) -> None:
200200
if arch not in _MODEL_URLS or _MODEL_URLS[arch] is None:
201-
raise NotImplementedError(f"No checkpoint is available for model type {arch}")
201+
raise NotImplementedError(f"No pre-trained weights are available for model type {arch}")
202202
checkpoint_url = _MODEL_URLS[arch]
203203
model.load_state_dict(load_state_dict_from_url(checkpoint_url, progress=progress))
204204

torchvision/models/mobilenetv3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def _mobilenet_v3(
294294
model = MobileNetV3(inverted_residual_setting, last_channel, **kwargs)
295295
if pretrained:
296296
if model_urls.get(arch, None) is None:
297-
raise NotImplementedError(f"No checkpoint is available for model type {arch}")
297+
raise NotImplementedError(f"No pre-trained weights are available for model type {arch}")
298298
state_dict = load_state_dict_from_url(model_urls[arch], progress=progress)
299299
model.load_state_dict(state_dict)
300300
return model

torchvision/models/quantization/mobilenetv3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def fuse_model(self, is_qat: Optional[bool] = None) -> None:
114114

115115
def _load_weights(arch: str, model: QuantizableMobileNetV3, model_url: Optional[str], progress: bool) -> None:
116116
if model_url is None:
117-
raise NotImplementedError(f"No checkpoint is available for model type {arch}")
117+
raise NotImplementedError(f"No pre-trained weights are available for model type {arch}")
118118
state_dict = load_state_dict_from_url(model_url, progress=progress)
119119
model.load_state_dict(state_dict)
120120

torchvision/models/regnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def _regnet(arch: str, block_params: BlockParams, pretrained: bool, progress: bo
395395
model = RegNet(block_params, norm_layer=norm_layer, **kwargs)
396396
if pretrained:
397397
if arch not in model_urls:
398-
raise NotImplementedError(f"No checkpoint is available for model type {arch}")
398+
raise NotImplementedError(f"No pre-trained weights are available for model type {arch}")
399399
state_dict = load_state_dict_from_url(model_urls[arch], progress=progress)
400400
model.load_state_dict(state_dict)
401401
return model

torchvision/models/segmentation/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ def forward(self, x: Tensor) -> Dict[str, Tensor]:
4040

4141
def _load_weights(arch: str, model: nn.Module, model_url: Optional[str], progress: bool) -> None:
4242
if model_url is None:
43-
raise NotImplementedError(f"No checkpoint is available for model type {arch}")
43+
raise NotImplementedError(f"No pre-trained weights are available for model type {arch}")
4444
state_dict = load_state_dict_from_url(model_url, progress=progress)
4545
model.load_state_dict(state_dict)

0 commit comments

Comments
 (0)