Skip to content

Commit bbb4a9a

Browse files
authored
Add warning and note docs for scipy (#1842) (#1966)
1 parent b70e333 commit bbb4a9a

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

docs/source/models.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ This directory can be set using the `TORCH_MODEL_ZOO` environment variable. See
7171
Some models use modules which have different training and evaluation
7272
behavior, such as batch normalization. To switch between these modes, use
7373
``model.train()`` or ``model.eval()`` as appropriate. See
74-
:meth:`~torch.nn.Module.train` or :meth:`~torch.nn.Module.eval` for details.
74+
:meth:`~torch.nn.Module.train` or :meth:`~torch.nn.Module.eval` for details.
7575

7676
All pre-trained models expect input images normalized in the same way,
7777
i.e. mini-batches of 3-channel RGB images of shape (3 x H x W),
@@ -183,11 +183,19 @@ Inception v3
183183

184184
.. autofunction:: inception_v3
185185

186+
.. note ::
187+
This requires `scipy` to be installed
188+
189+
186190
GoogLeNet
187191
------------
188192

189193
.. autofunction:: googlenet
190194

195+
.. note ::
196+
This requires `scipy` to be installed
197+
198+
191199
ShuffleNet v2
192200
-------------
193201

torchvision/datasets/caltech.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
class Caltech101(VisionDataset):
1111
"""`Caltech 101 <http://www.vision.caltech.edu/Image_Datasets/Caltech101/>`_ Dataset.
1212
13+
.. warning::
14+
15+
This class needs `scipy <https://docs.scipy.org/doc/>`_ to load target files from `.mat` format.
16+
1317
Args:
1418
root (string): Root directory of dataset where directory
1519
``caltech101`` exists or will be saved to if download is set to True.

torchvision/datasets/svhn.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ class SVHN(VisionDataset):
1313
we assign the label `0` to the digit `0` to be compatible with PyTorch loss functions which
1414
expect the class labels to be in the range `[0, C-1]`
1515
16+
.. warning::
17+
18+
This class needs `scipy <https://docs.scipy.org/doc/>`_ to load data from `.mat` format.
19+
1620
Args:
1721
root (string): Root directory of dataset where directory
1822
``SVHN`` exists.

torchvision/models/googlenet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def __init__(self, num_classes=1000, aux_logits=True, transform_input=False, ini
103103
else:
104104
self.aux1 = None
105105
self.aux2 = None
106-
106+
107107
self.avgpool = nn.AdaptiveAvgPool2d((1, 1))
108108
self.dropout = nn.Dropout(0.2)
109109
self.fc = nn.Linear(1024, num_classes)

0 commit comments

Comments
 (0)