排坑日记2:Could not find MSVC/GCC/CLANG installation on this computer.

论文链接

MAT: Mask-Aware Transformer for Large Hole Image Inpainting

问题描述

在复现MAT时,报如下错:

Could not find MSVC/GCC/CLANG installation on this computer. Check compiler_bindir_search_path list in “D:\project\MAT-main\torch_utils\custom_ops.py”.

报错提示custom_ops.py:
排坑日记2:Could not find MSVC/GCC/CLANG installation on this computer.

环境配置

python 3.6.13
pytorch 1.10.2
cuda 11.3
cudnn 8.0
上面为主要的环境,其余根据requirements.txt自行配置即可,这个环境容易配置

解决过程

先是百度查了一下报错内容,提示我缺少的是C++编译环境
关于C++编译环境的讨论

在网上查了查如何配置C++编译环境,总结为以下两个方案:

方案一

若你已经有C++编译环境,再好不过了,直接将custom_ops.py中patterns的C++编译环境换成自己的即可:
排坑日记2:Could not find MSVC/GCC/CLANG installation on this computer.将patterns替换成自己的:
排坑日记2:Could not find MSVC/GCC/CLANG installation on this computer.

方案二

如果你没有C++编译环境,那也不要慌,下面是配置C++编译环境的流程。

1.下载Microsoft Visual Studio19社区版本(17社区版本找了半天没找到,可能是官方下架了)

下载Microsoft Visual Studio19

2. 安装所需要的C++环境

下载完成后打开,会出现如下界面:
排坑日记2:Could not find MSVC/GCC/CLANG installation on this computer.

有两件事要做,一件是要把上面三个组件全都打上对勾!!!(不然会没有bin环境)

另一件是要自定义安装位置并且要记住自己的安装位置!!!

3.替换自己的C++环境

安装完成后,找到自己安装的位置(bin目录里面的X64环境)
排坑日记2:Could not find MSVC/GCC/CLANG installation on this computer.将上面的路径复制下来,替换到custom_ops.py文件里面:
排坑日记2:Could not find MSVC/GCC/CLANG installation on this computer.

运行结果

大功告成!
排坑日记2:Could not find MSVC/GCC/CLANG installation on this computer.
对比效果图:

自定义掩码
排坑日记2:Could not find MSVC/GCC/CLANG installation on this computer.排坑日记2:Could not find MSVC/GCC/CLANG installation on this computer.

随机掩码
排坑日记2:Could not find MSVC/GCC/CLANG installation on this computer.排坑日记2:Could not find MSVC/GCC/CLANG installation on this computer.
用作者的checkpoints整体跑下来效果真好,除了我贴的下面那个稍微有点垃圾以外,其他的即使大面积缺失像素点依然能修复出一个合理的人像。

参考链接

关于C++编译环境缺失的讨论

Microsoft Visual Studio安装过程

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
社会演员多的头像社会演员多普通用户
上一篇 2023年3月28日
下一篇 2023年3月28日

相关推荐