深度学习代码有个小问题 一直报错RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED 怎么解决呀 求求啦 cuda是10.2 torch是1.5.1 Python3.8版本 和官网的都一致 作者github上面给的torch环境就是torch1.5.1 Python≥3.8 都一样 不知道问题出在哪里了 希望好心人解答
望采纳
这个错误可能是由于 CUDA 的版本与驱动程序不兼容,或者是 GPU 资源不足,或者是 GPU 存储空间不足造成的。
一些可以尝试的解决办法:
1、检查 CUDA 和驱动程序的版本是否兼容,并尝试更新 CUDA 和驱动程序。
2、减小模型的大小,并减少批处理大小。
3、如果 GPU 空间不足,请尝试使用 GPU 清零命令清空 GPU 存储空间。
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Callable;
public static void main(String[] args) {
// 创建线程池
ExecutorService service = Executors.newSingleThreadExecutor();
// 创建任务
Callable<String> task = ()-> {
// 执行任务
System.out.println("Hello " + Thread.currentThread().getName());
return "hello";
};
service.submit(task);
// 关闭线程池
service.shutdown();
}
import java.io.File;
private static void checkAndDropMibeTable(String strPath) throws Exception {
// 1、检查驱动程序的版本是否兼容
File file = new File(strPath);
if (!file.exists()) {
System.out.println("Error - the driver of the MiBeDB Server is not installed!");
System.exit(0);
}
// 2、减小模型的大小
int size = (int) file.length();
int newModelSize = size / 4;
// 3、如果gers空间不足,请尝试使用pb清零命令清空模型。
if (newModelSize <= 0) {
System.out.println("Error - the model of the MiBeDB Server is not enough!");
System.exit(0);
}
System.out.println("Now we have the new model of the MiBeDB Server (" + newModelSize + " bytes).");
// 4、如果aker空间不足,请尝试使用pb清零命令清空模型。
if (newModelSize <= 0) {
System.out.println("Error - the model of the MiBeDB Server is not enough!");
System.exit(0);
}
System.out.println("Now we have the new model of the MiBeDB Server (" + newModelSize + " bytes).");
// 5、执行清零命令清空模型。
Runtime.getRuntime().exec("clear " + strPath);
}
cuda、pytorch和python分别什么版本?查下是否版本不匹配
不知道你这个问题是否已经解决, 如果还没有解决的话: