This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import platform | |
from typing import Optional | |
from urllib.error import HTTPError | |
from warnings import warn | |
from pytorch_lightning import LightningDataModule | |
from pytorch_lightning.utilities.imports import _TORCHVISION_AVAILABLE | |
from torch.utils.data import DataLoader, random_split |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytorch_lightning as pl | |
import torch | |
from pytorch_lightning.loggers.tensorboard import TensorBoardLogger | |
from pytorch_lightning.trainer.trainer import Trainer | |
from torch.nn import functional as F | |
from mnist_datamodule import MNISTDataModule | |
pl.seed_everything(42) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import IO | |
import requests | |
from requests.exceptions import RequestException | |
from tqdm import tqdm | |
def download_file(url: str, tmp_file: IO) -> None: | |
try: | |
r = requests.get(url) |