报错:not a directory “hipconfig“

在运行代码的当前环境下,找到cuda_to_hip_mappings.py 这个文件,具体来说是 anaconda3/envs/xxx/lib/python3.10/site-packages/torch/utils/hipify/cuda_to_hip_mappings.py

修改第37行,添加一个NotADirectoryError,最终变为

try:
    rocm_path = subprocess.check_output(["hipconfig", "--rocmpath"]).decode("utf-8")
except subprocess.CalledProcessError:
    print(f"Warning: hipconfig --rocmpath failed, assuming {rocm_path}")
# 修改这一行, 添加 NotADirectoryError
except (FileNotFoundError, PermissionError, NotADirectoryError ): 
    # Do not print warning. This is okay. This file can also be imported for non-ROCm builds.
    pass

原文链接:https://blog.csdn.net/ROokie_online/article/details/133874696

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容