当前位置:网站首页>Cuda版本不一致,编译apex报错

Cuda版本不一致,编译apex报错

2022-07-07 17:55:00 番茄就要炒鸡蛋

解决办法

注释掉setup.py代码中的第108行,cuda版本检验,这样编译就可以了

if "--cuda_ext" in sys.argv:
    from torch.utils.cpp_extension import CUDAExtension
    sys.argv.remove("--cuda_ext")

    if torch.utils.cpp_extension.CUDA_HOME is None:
        raise RuntimeError("--cuda_ext was requested, but nvcc was not found.  Are you sure your environment has nvcc available?  If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc.")
    else:
        # 注释掉这句
        # check_cuda_torch_binary_vs_bare_metal(torch.utils.cpp_extension.CUDA_HOME)

原网站

版权声明
本文为[番茄就要炒鸡蛋]所创,转载请带上原文链接,感谢
https://blog.csdn.net/hejunran/article/details/125641624