title: ValueError: too many values to unpack while using torch tensors
body: <p>For a project on neural networks, I am using Pytorch and am working with the EMNIST dataset. </p>
  
  <p>The code that is already given loads in the dataset:</p>
  
  <pre><code>train_dataset = dsets.MNIST(root='./data', 
                              train=True, 
                              transform=transforms.ToTensor(),
                              download=True)
  </code></pre>
  
  <p>And prepares it:</p>
  
  <pre><code>train_loader = torch.utils.data.DataLoader(dataset=train_dataset, 
                                             batch_size=batch_size, 
                                             shuffle=True)
  </code></pre>
  
  <p>Then, when all the configurations of the network are defined, there is a for loop to train the model per epoch:</p>
  
  <pre><code> for i, (images, labels) in enumerate(train_loader):
  </code></pre>
  
  <p>In the example code this works fine. </p>
  
  <p>For my task, I am given a dataset that I load as follows:</p>
  
  <pre><code>emnist = scipy.io.loadmat("DIRECTORY/emnist-letters.mat")
  
  data = emnist ['dataset']
  X_train = data ['train'][0, 0]['images'][0, 0]
  y_train = data ['train'][0, 0]['labels'][0, 0]
  </code></pre>
  
  <p>Then, I create the train_dataset as follows:</p>
  
  <pre><code>train_dataset = np.concatenate((X_train, y_train), axis = 1)
  train_dataset = torch.from_numpy(train_dataset)
  </code></pre>
  
  <p>And use the same step to prepare it:</p>
  
  <pre><code>train_loader = torch.utils.data.DataLoader(dataset=train_dataset, 
                                             batch_size=batch_size, 
                                             shuffle=True)
  </code></pre>
  
  <p>However, when I try to use the same loop as before:</p>
  
  <pre><code>for i, (images, labels) in enumerate(train_loader):
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>ValueError: too many values to unpack (expected 2)
  </code></pre>
  
  <p>Who knows what I can do so that I can train my dataset with this loop?</p>