title: Where is this dimension error getting generated in my ADAM algorithm?
body: <p>I am working on main.py in this BRATS Unet</p>
  
  <p><a href="https://github.com/pykao/Modified-3D-UNet-Pytorch/blob/master/main.py" rel="nofollow noreferrer">https://github.com/pykao/Modified-3D-UNet-Pytorch/blob/master/main.py</a></p>
  
  <pre><code># create your optimizer
  print ("Creating Optimizer")
  ##optimizer = optim.adam(net.parameteres(), lr=)
  optimizer = torch.optim.Adam(model.parameters(), lr=args.lr)
  print ("Created! \n")
  
  trainloader = torch.utils.data.DataLoader(train_idx, batch_size=2, shuffle=True)
  testloader  = torch.utils.data.DataLoader(test_idx, batch_size=2, shuffle=False)
  
  for epoch in range(2):  # loop over the dataset multiple times
      running_loss = 0.0
      for i, data in enumerate(trainloader, 0):
          print("inside for")
          # get the inputs THIS ERRORS OUT
          inputs, labels = data
  
          # zero the parameter gradients
          optimizer.zero_grad()
  
          # forward + backward + optimize
          outputs = model(inputs)
          loss = criterion(outputs, target)
          loss.backward()
          optimizer.step()
  
          # print statistics
          running_loss += loss.item()
          if i % 2000 == 1999:    # print every 2000 mini-batches
              print('[%d, %5d] loss: %.3f' %
                    (epoch + 1, i + 1, running_loss / 2000))
              running_loss = 0.0
  
  print('Finished Training')
  </code></pre>
  
  <p>I get this output:</p>
  
  <pre><code>Creating Optimizer
  Created!
  
  inside for
  Traceback (most recent call last):
    File "main.py", line 109, in &lt;module&gt;
      outputs = model(inputs)
    File "/home/MAHEUNIX/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
      result = self.forward(*input, **kwargs)
    File "/mnt/c/Users/MAHE/Modified Unet3D Master -TestRun/model.py", line 99, in forward
      out = self.conv3d_c1_1(x)
    File "/home/MAHEUNIX/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
      result = self.forward(*input, **kwargs)
    File "/home/MAHEUNIX/anaconda3/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 448, in forward
      self.padding, self.dilation, self.groups)
  RuntimeError: Expected 5-dimensional input for 5-dimensional weight [16, 4, 3, 3, 3], but got 0-dimensional input of size [] instead
  </code></pre>
  
  <p>I am unfamiliar with PyTorch, and so trainloader, testloader are probably incorrectly used. Please assume I don't know much while you help me. Thanks.</p>
  
  <p>New error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/mnt/c/Users/MAHE/Modified Unet3D Master -TestRun/main.py", line 91, in &lt;module&gt;
      for id, info in enumerate(trainloader,0):
    File "/home/MAHEUNIX/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 615, in __next__
      batch = self.collate_fn([self.dataset[i] for i in indices])
    File "/home/MAHEUNIX/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 615, in &lt;listcomp&gt;
      batch = self.collate_fn([self.dataset[i] for i in indices])
  KeyError: 0
  </code></pre>