Try  “batch0[0]” instead of “batch0.0”.

  
      github.com
  
  
    wkentaro/pytorch-fcn/blob/master/examples/voc/train_fcn32s.py#L105 24

cfg = configurations[args.config]
out = get_log_dir('fcn32s', args.config, cfg)
resume = args.resume


os.environ['CUDA_VISIBLE_DEVICES'] = str(gpu)
cuda = torch.cuda.is_available()


torch.manual_seed(1337)
if cuda:
    torch.cuda.manual_seed(1337)


# 1. dataset


root = osp.expanduser('~/data/datasets')
kwargs = {'num_workers': 4, 'pin_memory': True} if cuda else {}
train_loader = torch.utils.data.DataLoader(
    torchfcn.datasets.SBDClassSeg(root, split='train', transform=True),
    batch_size=1, shuffle=True, **kwargs)
val_loader = torch.utils.data.DataLoader(
    torchfcn.datasets.VOC2011ClassSeg(
        root, split='seg11valid', transform=True),



  
  
    
    
  
  


gives a solution for weigfht and bias wise learning rate setting.
Just use function get_parameters()
def get_parameters(model, bias=False):
    import torch.nn as nn
    modules_skipped = (
        nn.ReLU,
        nn.MaxPool2d,
        nn.Dropout2d,
        nn.Sequential,
        torchfcn.models.FCN32s,
        torchfcn.models.FCN16s,
        torchfcn.models.FCN8s,
    )
    for m in model.modules():
        if isinstance(m, nn.Conv2d):
            if bias:
                yield m.bias
            else:
                yield m.weight
        elif isinstance(m, nn.ConvTranspose2d):
            # weight is frozen because it is just a bilinear upsampling
            if bias:
                assert m.bias is None
        elif isinstance(m, modules_skipped):
            continue
        else:
            raise ValueError('Unexpected module: %s' % str(m))