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()
程序
来源:CSDN
作者:LoveLkl
链接:https://blog.csdn.net/u010327784/article/details/103586360