Skip to content

Instantly share code, notes, and snippets.

@braindotai
Last active November 20, 2020 08:31
Show Gist options
  • Save braindotai/861df9f14418aa6dbd8b1428c898c252 to your computer and use it in GitHub Desktop.
Save braindotai/861df9f14418aa6dbd8b1428c898c252 to your computer and use it in GitHub Desktop.
import torch
from torch import nn, optim
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torchvision.datasets import ImageFolder
from torchvision import transforms
from torchsummary import summary
import wandb
import os, shutil
import imageio
from tqdm.auto import tqdm
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import ImageGrid
print('Pytorch Version:', torch.__version__)
print('GPU Available:', torch.cuda.is_available())
device = 'cuda' if torch.cuda.is_available() else 'cpu'
print('Setting device to:', device)
ckpt_root = 'drive/My Drive/Model-Checkpoints/Fake Anime - Pytorch'
if not os.path.isdir(ckpt_root):
os.mkdir(ckpt_root)
print('Making checkpoint dir for first time...')
progress_dir = os.path.join(ckpt_root, 'progress')
if not os.path.isdir(progress_dir):
os.mkdir(progress_dir)
print('Making progress dir for first time...')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment