国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Error checking compiler version for cl: [WinError 2] 系統(tǒng)找 不到指定的文件[已解決] pytorch c++混編報(bào)錯(cuò) Error checking compiler version for cl: [WinError 2] 系統(tǒng)找 不到指定的文件。

這篇具有很好參考價(jià)值的文章主要介紹了Error checking compiler version for cl: [WinError 2] 系統(tǒng)找 不到指定的文件[已解決] pytorch c++混編報(bào)錯(cuò) Error checking compiler version for cl: [WinError 2] 系統(tǒng)找 不到指定的文件。。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

pytorch c++混編報(bào)錯(cuò) Error checking compiler version for cl: [WinError 2] 系統(tǒng)找 不到指定的文件。

win11 pytorch 進(jìn)行C++編譯時(shí)出現(xiàn)錯(cuò)誤

(python37) H:\emd>python setup.py install
running install
running bdist_egg
running egg_info
creating emd.egg-info
writing emd.egg-info\PKG-INFO
writing dependency_links to emd.egg-info\dependency_links.txt
writing top-level names to emd.egg-info\top_level.txt
writing manifest file 'emd.egg-info\SOURCES.txt'
 D:\Anaconda_app\envs\python37\lib\site-packages\torch\utils\cpp_extension.py:370: UserWarning: Attempted to use ninja as the BuildExtension backend but we
could not find ninja.. Falling back to using the slow distutils backend. 
  warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'emd.egg-info\SOURCES.txt'
writing manifest file 'emd.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_ext
D:\Anaconda_app\envs\python37\lib\site-packages\torch\utils\cpp_extension.py:305: UserWarning: Error checking compiler version for cl: [WinError 2] 系統(tǒng)找
不到指定的文件。
  warnings.warn(f'Error checking compiler version for {compiler}: {error}')
building 'emd' extension
creating build
creating build\temp.win-amd64-3.7
……
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(427): note: 參見(jiàn)對(duì)正在編譯的類(lèi) 模板 實(shí)例化“OptionalBase<at::Tensor>”的
引用
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\ATen/core/TensorBody.h(734): note: 參見(jiàn)對(duì)正在編譯的類(lèi) 模板 實(shí)例化“c10::optional<at::Tensor>
”的引用
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(395): warning C4624: “c10::trivially_copyable_optimization_optional_base
<T>”: 已將析構(gòu)函數(shù)隱式定義為“已刪除”
        with
        [
            T=at::Tensor
        ]
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(476): warning C4814: “c10::optional<at::Tensor>::contained_val”: 在 C++
14 中,"constexpr" 將不表示“常量”;請(qǐng)考慮顯式指定“常量”
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(477): error C2556: “at::Tensor &c10::optional<at::Tensor>::contained_val
(void) const &”: 重載函數(shù)與“const at::Tensor &c10::optional<at::Tensor>::contained_val(void) const &”只是在返回類(lèi)型上不同
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(471): note: 參見(jiàn)“c10::optional<at::Tensor>::contained_val”的聲明
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(477): error C2373: “c10::optional<at::Tensor>::contained_val”: 重定義;
不同的類(lèi)型修飾符
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(471): note: 參見(jiàn)“c10::optional<at::Tensor>::contained_val”的聲明
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(476): warning C4814: “c10::optional<int64_t>::contained_val”: 在 C++14
中,"constexpr" 將不表示“常量”;請(qǐng)考慮顯式指定“常量”
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\ATen/core/TensorBody.h(774): note: 參見(jiàn)對(duì)正在編譯的類(lèi) 模板 實(shí)例化“c10::optional<int64_t>”的
引用
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(477): error C2556: “int64_t &c10::optional<int64_t>::contained_val(void)
 const &”: 重載函數(shù)與“const int64_t &c10::optional<int64_t>::contained_val(void) const &”只是在返回類(lèi)型上不同
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(471): note: 參見(jiàn)“c10::optional<int64_t>::contained_val”的聲明
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(477): error C2373: “c10::optional<int64_t>::contained_val”: 重定義;不
同的類(lèi)型修飾符
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(471): note: 參見(jiàn)“c10::optional<int64_t>::contained_val”的聲明
D:\Anaconda_app\envs\python37\lib\site-packages\torch\include\c10/util/Optional.h(477): fatal error C1003: 錯(cuò)誤計(jì)數(shù)超過(guò) 100;正在停止編譯
error: command 'D:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2


關(guān)鍵錯(cuò)誤 1.:UserWarning: Error checking compiler version for cl: [WinError 2] 系統(tǒng)找
不到指定的文件。

定位位置:D:\Anaconda_app\envs\python37\lib\site-packages\torch\utils\cpp_extension.py:305行

看看這個(gè)地方怎么有錯(cuò)誤:

    try:
        if sys.platform.startswith('linux'):
            minimum_required_version = MINIMUM_GCC_VERSION
            versionstr = subprocess.check_output([compiler, '-dumpfullversion', '-dumpversion'])
            version = versionstr.decode().strip().split('.')
        else:
            minimum_required_version = MINIMUM_MSVC_VERSION
            compiler_info = subprocess.check_output(compiler, stderr=subprocess.STDOUT)
            match = re.search(r'(\d+)\.(\d+)\.(\d+)', compiler_info.decode().strip())
            version = (0, 0, 0) if match is None else match.groups()
    except Exception:
        _, error, _ = sys.exc_info()
        warnings.warn(f'Error checking compiler version for {compiler}: {error}')
        return False

不是在linux平臺(tái),而是win平臺(tái),于是找到cl.exe的版本要求:

MINIMUM_MSVC_VERSION = (19, 0, 24215)# 這個(gè)在程序里面,txt文件打開(kāi),選定它,通過(guò)查找可以找到這個(gè)地方。

MSVC是一個(gè)編譯器,其編譯器名字叫"cl.exe",它是微軟專(zhuān)為VS開(kāi)發(fā)的一款編譯器。

上面語(yǔ)句寫(xiě)了 MSVC 最低的版本要求MSVC 19.0.24215.
?

MSC_VER的意思就是:Microsoft 的 C 編譯器的版本

MSC    1.0   _MSC_VER == 100
MSC    2.0   _MSC_VER == 200
MSC    3.0   _MSC_VER == 300
MSC    4.0   _MSC_VER == 400
MSC    5.0   _MSC_VER == 500
MSC    6.0   _MSC_VER == 600
MSC    7.0   _MSC_VER == 700
MSVC++ 1.0   _MSC_VER == 800
MSVC++ 2.0   _MSC_VER == 900
MSVC++ 4.0   _MSC_VER == 1000 (Developer Studio 4.0)
MSVC++ 4.2   _MSC_VER == 1020 (Developer Studio 4.2)
MSVC++ 5.0   _MSC_VER == 1100 (Visual Studio 97 version 5.0)
MSVC++ 6.0   _MSC_VER == 1200 (Visual Studio 6.0 version 6.0)
MSVC++ 7.0   _MSC_VER == 1300 (Visual Studio .NET 2002 version 7.0)
MSVC++ 7.1   _MSC_VER == 1310 (Visual Studio .NET 2003 version 7.1)
MSVC++ 8.0   _MSC_VER == 1400 (Visual Studio 2005 version 8.0)
MSVC++ 9.0   _MSC_VER == 1500 (Visual Studio 2008 version 9.0)
MSVC++ 10.0  _MSC_VER == 1600 (Visual Studio 2010 version 10.0)
MSVC++ 11.0  _MSC_VER == 1700 (Visual Studio 2012 version 11.0)
MSVC++ 12.0  _MSC_VER == 1800 (Visual Studio 2013 version 12.0)
MSVC++ 14.0  _MSC_VER == 1900 (Visual Studio 2015 version 14.0)
MSVC++ 14.1  _MSC_VER == 1910 (Visual Studio 2017 version 15.0)
MSVC++ 14.11 _MSC_VER == 1911 (Visual Studio 2017 version 15.3)
MSVC++ 14.12 _MSC_VER == 1912 (Visual Studio 2017 version 15.5)
MSVC++ 14.13 _MSC_VER == 1913 (Visual Studio 2017 version 15.6)
MSVC++ 14.14 _MSC_VER == 1914 (Visual Studio 2017 version 15.7)
MSVC++ 14.15 _MSC_VER == 1915 (Visual Studio 2017 version 15.8)
MSVC++ 14.16 _MSC_VER == 1916 (Visual Studio 2017 version 15.9)
MSVC++ 14.2  _MSC_VER == 1920 (Visual Studio 2019 Version 16.0)
MSVC++ 14.21 _MSC_VER == 1921 (Visual Studio 2019 Version 16.1)
MSVC++ 14.22 _MSC_VER == 1922 (Visual Studio 2019 Version 16.2)

注意這是它要求的最低版本,如果你安裝vs2019,2022,在安裝的地方有cl.exe。需要搜索一下,然后把cl.exe所在的路徑添加到系統(tǒng)環(huán)境變量中,也就是path中,別忘了重啟電腦。問(wèn)題解決

第一步解決。

錯(cuò)誤 2.D:\Anaconda_app\envs\python37\lib\site-packages\torch\utils\cpp_extension.py:370: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja… Falling back to using the slow distutils backend.
?

沒(méi)有安裝 ninja...。這個(gè)ninja是什么東東,這里不管一會(huì)安裝上就行

如何安裝ninja

pip install ninja

運(yùn)行結(jié)果文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-687388.html

Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting ninja
  Downloading ninja-1.11.1-py2.py3-none-win_amd64.whl (313 kB)
     |████████████████████████████████| 313 kB 939 kB/s
Installing collected packages: ninja
Successfully installed ninja-1.11.1

到了這里,關(guān)于Error checking compiler version for cl: [WinError 2] 系統(tǒng)找 不到指定的文件[已解決] pytorch c++混編報(bào)錯(cuò) Error checking compiler version for cl: [WinError 2] 系統(tǒng)找 不到指定的文件。的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶(hù)投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • [Visual Studio C盤(pán)找不到VC/Bin文件]nvcc fatal : Cannot find compiler ‘cl.exe‘ in PATH

    [Visual Studio C盤(pán)找不到VC/Bin文件]nvcc fatal : Cannot find compiler ‘cl.exe‘ in PATH

    在用nvcc文件編譯CUDA程序(.cu文件)時(shí)候報(bào)了以下錯(cuò)誤: nvcc fatal : Cannot find compiler ‘cl.exe‘ in PATH 該問(wèn)題是因?yàn)橄到y(tǒng)找不到cl.exe文件 網(wǎng)上都說(shuō)是要將 C:Program FilesMicrosoft Visual Studio 10.0VCbin 文件目錄加入到環(huán)境變量中,但我在電腦里找不到該目錄。 經(jīng)過(guò)一番查找發(fā)現(xiàn),新版本

    2024年02月04日
    瀏覽(21)
  • QT使用MSVC編譯器報(bào)錯(cuò):Project ERROR: Cannot run compiler ‘cl‘以及后續(xù)問(wèn)題解決

    QT使用MSVC編譯器報(bào)錯(cuò):Project ERROR: Cannot run compiler ‘cl‘以及后續(xù)問(wèn)題解決

    記錄一次qtcreator工程使用MSVC創(chuàng)建報(bào)錯(cuò)“ Project ERROR: Cannot run compiler ‘cl’ ”,沒(méi)辦法運(yùn)行編譯器cl。 只顯示 qmake配置文件 不出現(xiàn)工程文件, 在qtcreator安裝目錄下的MSVC2017確實(shí)并未找到cl.exe文件,于是下載了everything搜索軟件,在電腦上找到了VSstudio的安裝目錄下MSVC2017編譯器下

    2024年02月05日
    瀏覽(32)
  • OSError: [WinError 127] 找不到指定的程序。 Error loading “..... ***.dll“ or one of its dependencies.

    背景: ?? 利用命令 conda install --offline torch package fully name 安裝離線 torch 包后,然后進(jìn)入自己創(chuàng)建的虛擬環(huán)境( conda activate environment name ),輸入 python 后 import torch 時(shí)報(bào)錯(cuò)。 報(bào)錯(cuò)信息: 報(bào)錯(cuò)分析: ??根據(jù)報(bào)錯(cuò)信息關(guān)鍵提示 Error loading \\\"...**.dll\\\" or one of its dependencies. 可知

    2024年02月15日
    瀏覽(22)
  • 解決Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version ...

    解決Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version ...

    ? 百度出來(lái)基本上都是說(shuō)要升級(jí)Kotlin插件版本(結(jié)尾有彩蛋) 需要關(guān)注才能看的帖子,比較詳細(xì),但是對(duì)我無(wú)效 解決Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of .._念兮為美的博客-CSDN博客 網(wǎng)上方法一大堆,我也試錯(cuò)了許多,這里就不一 一展示了

    2024年02月07日
    瀏覽(18)
  • Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of

    Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of

    問(wèn)題原因 idea 中的 kotlin 插件版本比 pom 中的低,導(dǎo)致無(wú)法啟動(dòng) 解決方式 把項(xiàng)目 pom 中的版本降低 或 升級(jí)下idea插件的版本 實(shí)際解決 pom 中的一般我們沒(méi)有辦法輕易改動(dòng),這里選擇升級(jí)idea 中的插件,共兩種方式 第一種(推薦) : 通過(guò)左上角菜單進(jìn)入 settings 或者 直接快捷鍵

    2024年02月07日
    瀏覽(22)
  • 解決WARNING: There was an error checking the latest version of pip.

    解決WARNING: There was an error checking the latest version of pip.

    在安裝包是出現(xiàn)上圖的警告。 報(bào)錯(cuò)內(nèi)容翻譯: 警告:檢查最新版本的pip時(shí)出錯(cuò)。 報(bào)錯(cuò)原因 報(bào)錯(cuò)原因:需要升級(jí)pip版本才可以安裝其他模塊。 解決方法:升級(jí)pip

    2024年02月12日
    瀏覽(22)
  • 解決Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of ..

    解決Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of ..

    今天在啟動(dòng)項(xiàng)目時(shí),項(xiàng)目啟動(dòng)不起來(lái),報(bào)錯(cuò): Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13. 如下圖所示: 經(jīng)過(guò)分析,發(fā)現(xiàn)是ideade Kotlin版本過(guò)低導(dǎo)致,有兩種解決方式: ????一是將項(xiàng)目中的 Kotlin 版本降低;

    2024年01月18日
    瀏覽(64)
  • Keil ARM Compiler(Use default compliler version 5)error: ‘#pragma import‘...解決辦法

    Keil ARM Compiler(Use default compliler version 5)error: ‘#pragma import‘...解決辦法

    Keil編譯出現(xiàn)error: ‘#pragma import’ is an ARM Compiler 5 extension, and is not supported by ARM Compiler 6 [-Warmcc-pragma-import] 原因是Keil安裝version 5版本的ARM Compiler(Use default compliler version 5),當(dāng)我們使用新版本keil5創(chuàng)建寄存器模板,而選擇了其他編譯版本例如選擇Use default compliler version 6)會(huì)報(bào)出來(lái)

    2024年01月19日
    瀏覽(26)
  • Error:Kotlin: Module was compiled with an incompatible version of Kotlin. 處理

    Error:Kotlin: Module was compiled with an incompatible version of Kotlin. 處理

    啟動(dòng)項(xiàng)目時(shí)報(bào)錯(cuò) Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.1.16. 原因是項(xiàng)目的Kotlin版本和idea的不匹配。解決:將idea的Kotlin版本升級(jí),升級(jí)完需要重啟idea

    2024年02月16日
    瀏覽(14)
  • Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its

    Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its

    報(bào)錯(cuò): ????????Error:Kotlin:?Module?was?compiled?with?an?incompatible?version?of?Kotlin.?The?binary?version?of?its?metadata?is?1.7.1,?expected?version?is?1.1.16. 解決方案: 非常簡(jiǎn)單:Build---Rebuild project,再運(yùn)行就沒(méi)問(wèn)題了。 如果不行可以嘗試: ????????在項(xiàng)目的構(gòu)建文件(如 pom.xm

    2024年02月07日
    瀏覽(18)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包