gcc和cuda的版本相适应关系:gcc与cuda版本对应关系_cuda和gcc版本对应-优快云博客
问题:RuntimeError: Failed to find C compiler. Please specify via CC environment variable.
解决方法:apt-get install build-essential( --no-upgrade 用不用都无所谓)
显示libc6升级 家人们可以升级,不影响cuda内核变动(帮你试过心惊胆战的半小时查找资料)
pytorch_lighting版本适配问题
pytorch、pytorch_lightning、torchmetrics版本对应_pytorch-lightning版本对应-优快云博客
torchmetrics== 0.7.0 triton==2.1.0
ModuleNotFoundError: No module named 'pytorch_lightning.metrics'
法一:修改
from pytorch_lightning.metrics import Accuracy, Precision, Recall, F1
为:(之前的版本被弃用了)
from torchmetrics import Accuracy, Precision, Recall, F1Score
ValueError: The `target` has to be an integer tensor.
使用计算函数前转换为long型
修改
accscore = acc_eval(pred.cpu(),mask.cpu())
为:
accscore = acc_eval(pred.cpu(), mask.cpu().long())
ValueError: Your data is binary and `num_classes=2`, but `multiclass` is not True. Set it to True if you want to transform binary data to multi-class format.
思路1:下载高版本的torchmetrics ==1.5.1 导致triton-2.1.0被迫变为triton-2.0.0
思路2:直接pip下载 安装了torchmetrics-1.5.2 但是修改 triton-2.0.0
TypeError: Accuracy.__new__() missing 1 required positional argument: 'task'
from torchmetrics.classification import BinaryAccuracy
acc_eval = BinaryAccuracy()
AttributeError: module 'triton.language' has no attribute 'cumsum'
修改trion为>=2.1.0
成功运行!
module 'pytorch_lightning' has no attribute 'metrics'
改为以下代码
import torchmetrics
metrics = torchmetrics.Accuracy()