title: No CUDA GPUs are available
body: <p>i get this error from the method during the model training process. i am using the google colab to run the code. the google colab dont have any GPU. Is their any other way i can make the code run without requiring cuda cpu.</p>
  <p>How can i fix this error ?</p>
  <pre><code>def train_model(model, train_loader, val_loader, epoch, loss_function, optimizer, path, early_stop):
     
      # GPU
     #device = torch.device(&quot;cuda:0&quot; if torch.cuda.is_available() else &quot;cpu&quot;)
      device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
  #     device = torch.device(&quot;cpu&quot;)
      device = torch.device(&quot;cuda&quot;)
      model = model.to(device)
      
  
      patience, eval_loss = 0, 0
      
      # train
      for i in range(epoch):
          total_loss, count = 0, 0
          y_pred = list()
          y_true = list()
          for idx, (x, y) in tqdm(enumerate(train_loader), total=len(train_loader)):
              x, y = x.to(device), y.to(device) 
              u, m = model(x)
              predict = torch.sigmoid(torch.sum(u*m, 1))
              y_pred.extend(predict.cpu().detach().numpy())
              y_true.extend(y.cpu().detach().numpy())
              loss = loss_function(predict, y.float())
              optimizer.zero_grad()
              loss.backward()
              optimizer.step()
              total_loss += float(loss)
              count += 1
              
          train_auc = roc_auc_score(np.array(y_true), np.array(y_pred))
          torch.save(model, path.format(i+1))
          print(&quot;Epoch %d train loss is %.3f and train auc is %.3f&quot; % (i+1, total_loss / count, train_auc))
      
          # verify
          total_eval_loss = 0
          model.eval()
          count_eval = 0
          val_y_pred = list()
          val_true = list()
          for idx, (x, y) in tqdm(enumerate(val_loader), total=len(val_loader)):
              x, y = x.to(device), y.to(device)
              u, m = model(x)
              predict = torch.sigmoid(torch.sum(u*m, 1))
              val_y_pred.extend(predict.cpu().detach().numpy())
              val_true.extend(y.cpu().detach().numpy())
              loss = loss_function(predict, y.float())
              total_eval_loss += float(loss)
              count_eval += 1
          val_auc = roc_auc_score(np.array(y_true), np.array(y_pred))
          print(&quot;Epoch %d val loss is %.3fand train auc is %.3f&quot; % (i+1, total_eval_loss / count_eval, val_auc))
          
  
  </code></pre>