title: ValueError: Classification metrics can't handle a mix of multiclass and continuous-multioutput targets
body: <p>I am trying to calculate the f1 score for a multi-class classification problem using the Cifar10 dataset. I am importing f1 metirics from the sklearn library. However I keep getting the following error message:</p>
  <pre><code>ValueError: Classification metrics can't handle a mix of multiclass and continuous-multioutput targets
  
  </code></pre>
  <p>Below is my function for testing the model on my validation set. Would someone be able to explain how to calculate f1 when performing multi-class classification. I am getting quite confused.</p>
  <pre><code>@torch.no_grad()
  def valid_function(model, optimizer, val_loader):
    model.eval()
  
    val_loss = 0.0
    val_accu = 0.0
    f_one = []
    for i, (x_val, y_val) in enumerate(val_loader):
  
      x_val, y_val = x_val.to(device), y_val.to(device)
  
      val_pred = model(x_val)
      loss = criterion(val_pred, y_val)
  
      val_loss += loss.item()
      val_accu += accuracy(val_pred, y_val)
      f_one.append(f1_score(y_val.cpu(), val_pred.cpu()))
  
  
    val_loss /= len(val_loader)
    val_accu /= len(val_loader)
        
    print('Val Loss: %.3f | Val Accuracy: %.3f'%(val_loss,val_accu))
  
    return val_loss, val_accu
  
  
  </code></pre>