pytorch使用cuda报错RuntimeError: CUDA error: unknown error

pytorch使用cuda报错RuntimeError: CUDA error: unknown error

 

加上torch.cuda.current_device()

例如

import os
import torch
import torch.nn as nn
import argparse
from sklearn import metrics
from torch.utils.data import DataLoader
from models import LSTM, AE_LSTM, ATAE_LSTM, PBAN
from data_utils import SentenceDataset, build_tokenizer, build_embedding_matrix

torch.cuda.current_device()

程序

你可能感兴趣的:(python,pytorch)