本人的研究方向是图像去雾,在服务器运行代码时报出如下错误,搜索后发现找不到相关的解决方法,还请大家帮我看看,该怎么解决。
报错内容:File "train.py", line 226, in
gp_loss = gp_struct.compute_gploss(zy_in, imgid,batch_id,0)
File "/home/mist/GP.py", line 304, in compute_gploss
loss_unsup = torch.mean(((tensor_vec-mean_pred)*2)/sigma_est[0]) + 1.0self.lambda_vartorch.log(torch.det(sigma_est)) - 0.000001self.lambda_var*torch.log(torch.det(far_sigma_est))
RuntimeError: Calling torch.lu on a CUDA tensor requires compiling PyTorch with MAGMA. lease rebuild with MAGMA.
loss_unsup = torch.mean(((tensor_vec-mean_pred)*2)/sigma_est[0]) + 1.0self.lambda_vartorch.log(torch.det(sigma_est)) - 0.000001self.lambda_var*torch.log(torch.det(far_sigma_est))
根据报错提示,上面这行代码疑似进行了矩阵的LU分解,而且该LU分解是对CUDA上的张量进行操作的。我估计是因为使用了torch.det函数,但传递给该函数的参数不满足这个条件“Calculates determinant of a square matrix or batches of square matrices”,参考:
https://pytorch.org/docs/1.7.0/generated/torch.det.html
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!