Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix for torchvision #6476

Merged
merged 2 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pl_examples/basic_examples/autoencoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
import pytorch_lightning as pl
from pl_examples import _DATASETS_PATH, _TORCHVISION_AVAILABLE, _TORCHVISION_MNIST_AVAILABLE, cli_lightning_logo

if _TORCHVISION_AVAILABLE and _TORCHVISION_MNIST_AVAILABLE:
if _TORCHVISION_AVAILABLE:
from torchvision import transforms
from torchvision.datasets.mnist import MNIST
if _TORCHVISION_MNIST_AVAILABLE:
from torchvision.datasets import MNIST
else:
from tests.helpers.datasets import MNIST

Expand Down
5 changes: 3 additions & 2 deletions pl_examples/basic_examples/backbone_image_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
import pytorch_lightning as pl
from pl_examples import _DATASETS_PATH, _TORCHVISION_AVAILABLE, _TORCHVISION_MNIST_AVAILABLE, cli_lightning_logo

if _TORCHVISION_AVAILABLE and _TORCHVISION_MNIST_AVAILABLE:
if _TORCHVISION_AVAILABLE:
from torchvision import transforms
from torchvision.datasets.mnist import MNIST
if _TORCHVISION_MNIST_AVAILABLE:
from torchvision.datasets import MNIST
else:
from tests.helpers.datasets import MNIST

Expand Down
5 changes: 3 additions & 2 deletions pl_examples/basic_examples/dali_image_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
cli_lightning_logo,
)

if _TORCHVISION_AVAILABLE and _TORCHVISION_MNIST_AVAILABLE:
if _TORCHVISION_AVAILABLE:
from torchvision import transforms
from torchvision.datasets.mnist import MNIST
if _TORCHVISION_MNIST_AVAILABLE:
from torchvision.datasets import MNIST
else:
from tests.helpers.datasets import MNIST

Expand Down
3 changes: 2 additions & 1 deletion pl_examples/basic_examples/mnist_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
from pl_examples import _DATASETS_PATH, _TORCHVISION_AVAILABLE, _TORCHVISION_MNIST_AVAILABLE
from pytorch_lightning import LightningDataModule

if _TORCHVISION_AVAILABLE and _TORCHVISION_MNIST_AVAILABLE:
if _TORCHVISION_AVAILABLE:
from torchvision import transforms as transform_lib
if _TORCHVISION_MNIST_AVAILABLE:
from torchvision.datasets import MNIST
else:
from tests.helpers.datasets import MNIST
Expand Down
5 changes: 3 additions & 2 deletions pl_examples/domain_templates/generative_adversarial_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
from pytorch_lightning.core import LightningDataModule, LightningModule
from pytorch_lightning.trainer import Trainer

if _TORCHVISION_AVAILABLE and _TORCHVISION_MNIST_AVAILABLE:
if _TORCHVISION_AVAILABLE:
import torchvision
import torchvision.transforms as transforms
from torchvision import transforms
if _TORCHVISION_MNIST_AVAILABLE:
from torchvision.datasets import MNIST
else:
from tests.helpers.datasets import MNIST
Expand Down