Sure thing Kaiser, here is my full train.py in a gist:

  
      gist.github.com
  
  
    https://gist.github.com/FuriouslyCurious/698e95a4c79fdaa37c32d3b2076a95ac 8
train.py
#!/usr/bin/env python3

import argparse
import torch

import torch.nn as nn
import torch.optim as optim

import torch.nn.functional as F
from torch.autograd import Variable
This file has been truncated. show original




  
  
    
    
  
  


I have tweaked only a couple of lines from Brandon Amos’s original DenseNet implementation, by replacing CIFAR10 loaded with ImageFolder loader:

  
      github.com
  
  
    bamos/densenet.pytorch/blob/master/train.py 6
#!/usr/bin/env python3

import argparse
import torch

import torch.nn as nn
import torch.optim as optim

import torch.nn.functional as F
from torch.autograd import Variable

import torchvision.datasets as dset
import torchvision.transforms as transforms
from torchvision.utils import save_image

from torch.utils.data import DataLoader

import os
import sys
import math


  This file has been truncated. show original

  
  
    
    
  
  


Thanks!