RuntimeError                              Traceback (most recent call last)
 in ()
77 # train the model
78 model_scratch = train(20, loaders_scratch, model_scratch, optimizer_scratch,
—> 79                       criterion_scratch, use_cuda, ‘model_scratch.pt’)
80
81 # load the model that got the best validation accuracy
 in train(n_epochs, loaders, model, optimizer, criterion, use_cuda, save_path)
42         ######################
43         model.eval()
—> 44         for batch_idx, (data, target) in enumerate(loaders[‘valid’]):
45             # move to GPU
46             if use_cuda:
/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py in next(self)
262         if self.num_workers == 0:  # same-process loading
263             indices = next(self.sample_iter)  # may raise StopIteration
–> 264             batch = self.collate_fn([self.dataset[i] for i in indices])
265             if self.pin_memory:
266                 batch = pin_memory_batch(batch)
/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py in default_collate(batch)
136     elif isinstance(batch[0], collections.Sequence):
137         transposed = zip(*batch)
–> 138         return [default_collate(samples) for samples in transposed]
139
140     raise TypeError((error_msg.format(type(batch[0]))))
/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py in (.0)
136     elif isinstance(batch[0], collections.Sequence):
137         transposed = zip(*batch)
–> 138         return [default_collate(samples) for samples in transposed]
139
140     raise TypeError((error_msg.format(type(batch[0]))))
/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py in default_collate(batch)
113             storage = batch[0].storage().new_shared(numel)
114             out = batch[0].new(storage)
–> 115         return torch.stack(batch, 0, out=out)
116     elif elem_type.module == ‘numpy’ and elem_type.name != 'str’ 
117             and elem_type.name != ‘string_’:
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 385 and 341 in dimension 2 at /opt/conda/conda-bld/pytorch_1524584710464/work/aten/src/TH/generic/THTensorMath.c:3586