Traceback (most recent call last):

  File "<ipython-input-5-ede2393ccf01>", line 104, in <module>
    for i, data in enumerate(dataloader, 0):

  File "C:\Users\anesh\Anaconda3\envs\virtual_platform\lib\site-packages\torch\utils\data\dataloader.py", line 281, in __next__
    return self._process_next_batch(batch)

  File "C:\Users\anesh\Anaconda3\envs\virtual_platform\lib\site-packages\torch\utils\data\dataloader.py", line 301, in _process_next_batch
    raise batch.exc_type(batch.exc_msg)

RuntimeError: Traceback (most recent call last):
  File "C:\Users\anesh\Anaconda3\envs\virtual_platform\lib\site-packages\torch\utils\data\dataloader.py", line 55, in _worker_loop
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "C:\Users\anesh\Anaconda3\envs\virtual_platform\lib\site-packages\torch\utils\data\dataloader.py", line 135, in default_collate
    return [default_collate(samples) for samples in transposed]
  File "C:\Users\anesh\Anaconda3\envs\virtual_platform\lib\site-packages\torch\utils\data\dataloader.py", line 135, in <listcomp>
    return [default_collate(samples) for samples in transposed]
  File "C:\Users\anesh\Anaconda3\envs\virtual_platform\lib\site-packages\torch\utils\data\dataloader.py", line 112, in default_collate
    return torch.stack(batch, 0, out=out)
  File "C:\Users\anesh\Anaconda3\envs\virtual_platform\lib\site-packages\torch\functional.py", line 66, in stack
    return torch.cat(inputs, dim, out=out)
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 115 and 100 in dimension 2 at c:\anaconda2\conda-bld\pytorch_1519492996300\work\torch\lib\th\generic/THTensorMath.c:2897

I changed the batch_size=10 and removed the view(-1).Iam getting this error.I read that images in a batch must be of equal shape as they are stored as tensor.Thats y I set the batch_size=1.