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

ValueError: The device should not be ‘gpu‘, since PaddlePaddle is not compiled with CUDA問題解決(Paddle)

這篇具有很好參考價(jià)值的文章主要介紹了ValueError: The device should not be ‘gpu‘, since PaddlePaddle is not compiled with CUDA問題解決(Paddle)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

一、問題描述

兩個(gè)問題一并解決:

<1>

Traceback (most recent call last):
? File "run_trainer_ernie_gen.py", line 120, in <module>
? ? paddle.set_device(trainer_params.get("PADDLE_PLACE_TYPE", "cpu"))
? File "/opt/conda/envs/ERNIE-GEN/lib/python3.7/site-packages/paddle/device/__init__.py", line 204, in set_device
? ? place = _convert_to_place(device)
? File "/opt/conda/envs/ERNIE-GEN/lib/python3.7/site-packages/paddle/device/__init__.py", line 127, in _convert_to_place
? ? raise ValueError("The device should not be 'gpu', "
ValueError: The device should not be 'gpu', since PaddlePaddle is not compiled with CUDA

ValueError: The device should not be ‘gpu‘, since PaddlePaddle is not compiled with CUDA問題解決(Paddle)

?<2>

RuntimeError: (PreconditionNotMet) Cannot load cudnn shared library. Cannot invoke method cudnnGetVersion.
? [Hint: cudnn_dso_handle should not be null.] (at /paddle/paddle/phi/backends/dynload/cudnn.cc:59)

ValueError: The device should not be ‘gpu‘, since PaddlePaddle is not compiled with CUDA問題解決(Paddle)

?問題總結(jié):paddlepaddle調(diào)用不了GPU

二、問題解決

很多博客說安裝cudatoolkit=10.2就可以解決,但是我不行(可能因?yàn)槲沂怯玫膁ocker 容器)

如果在本機(jī)上安裝,可以直接conda安裝:

conda install cudatoolkit=10.2

而docker中我選擇直接去官網(wǎng)下載:

https://developer.nvidia.com/rdp/cudnn-archive

下載內(nèi)容為:?

ValueError: The device should not be ‘gpu‘, since PaddlePaddle is not compiled with CUDA問題解決(Paddle)

?切記!一定要選用這個(gè)!

下載完畢,移動(dòng)到/usr/local/目錄下:

tar -xvf cudnn-10.2-linux-x64-v7.6.5.32.tgz
sudo cp cuda/lib64/* /usr/local/cuda-10.2/lib
sudo cp cuda/lib64/* /usr/local/cuda-10.2/lib64/

解壓好CUDA后,下面配置path:

export  PATH=/usr/local/cuda-10.2/bin:$PATH
export  LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64$LD_LIBRARY_PATH

這時(shí)候已經(jīng)大功告成了!

但是我這時(shí)候報(bào)這個(gè)錯(cuò)誤:

ValueError: The device should not be ‘gpu‘, since PaddlePaddle is not compiled with CUDA問題解決(Paddle)

檢查一圈發(fā)現(xiàn)需要安裝?paddlepaddle-gpu:

pip install paddlepaddle-gpu

大功告成!

成功的樣子:

ValueError: The device should not be ‘gpu‘, since PaddlePaddle is not compiled with CUDA問題解決(Paddle)

?文章來源地址http://www.zghlxwxcb.cn/news/detail-401782.html

到了這里,關(guān)于ValueError: The device should not be ‘gpu‘, since PaddlePaddle is not compiled with CUDA問題解決(Paddle)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(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)文章

  • avoid mutating a prop directly since the value will be overwritten whenever完美解決

    avoid mutating a prop directly since the value will be overwritten whenever完美解決

    在vue父組件傳遞數(shù)據(jù)給子組件時(shí)候,通過雙向綁定給屬性賦值時(shí)候,報(bào)錯(cuò)如下:Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop\\\'s value. Prop being mutated: \\\"content\\\" 改動(dòng)了子組件中引用的父組件的變量,

    2024年02月12日
    瀏覽(17)
  • 【warning】UserWarning: The parameter ‘pretrained‘ is deprecated since 0.13 and may be removed

    【warning】UserWarning: The parameter ‘pretrained‘ is deprecated since 0.13 and may be removed

    報(bào)錯(cuò)內(nèi)容: 翻譯一下,就是參數(shù)列表中的pretrained在新版本中被棄了,要使用weights這個(gè)參數(shù)。然后教你用新的參數(shù)。 就按照watning里寫的把models.resnet101()后面的內(nèi)容重新設(shè)置就好。 第一種:weights = models.ResNet101_Weights.DEFAULT 輸出結(jié)果:? 第二種:weights = models.ResNet101_Weights.IMA

    2024年02月13日
    瀏覽(20)
  • [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent c

    [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent c

    報(bào)錯(cuò)翻譯:避免直接更改一個(gè)prop,因?yàn)槊慨?dāng)父組件重新渲染時(shí),該值都會(huì)被覆蓋。相反,應(yīng)使用基于prop值的數(shù)據(jù)或計(jì)算屬性。正在更改的prop:“activeId” 解決辦法,使用基于prop的值,即把名為activeId的prop的值放在另一個(gè)變量中,對(duì)那個(gè)變量進(jìn)行修改,不修改activeId。 1、實(shí)

    2024年02月03日
    瀏覽(29)
  • 已解決ValueError: All arrays must be of the same length

    已解決ValueError: All arrays must be of the same length

    已解決(pandas創(chuàng)建DataFrame對(duì)象報(bào)錯(cuò))ValueError: All arrays must be of the same length 粉絲群里面的一個(gè)粉絲用pandas創(chuàng)建DataFrame對(duì)象,但是發(fā)生了報(bào)錯(cuò)(跑來找我求助,然后順利幫助他解決了,順便記錄一下希望可以幫助到更多遇到這個(gè)bug不會(huì)解決的小伙伴),報(bào)錯(cuò)信息和代碼如下: 報(bào)

    2024年02月02日
    瀏覽(27)
  • eslint提示 xxx should be listed in the project's dependencies

    eslint提示 xxx should be listed in the project's dependencies

    有時(shí)候手動(dòng)安裝了一個(gè)npm包A,npm包A里面包含了npm包B,這時(shí)候如果 eslint會(huì)報(bào)錯(cuò),提示 npm包B 不在 package.json 里面 ?解決方法:在 eslintrc.js 增加配置

    2024年02月03日
    瀏覽(22)
  • 2023/8/19 - At all times, the focus should be on controlling one‘s emotions
  • RuntimeError: Input type (unsigned char) and bias type (float) should be the same錯(cuò)誤

    這個(gè)錯(cuò)誤通常是由于輸入數(shù)據(jù)類型與模型參數(shù)的類型不匹配導(dǎo)致的。在PyTorch中,當(dāng)輸入的張量類型與模型的參數(shù)類型不匹配時(shí),PyTorch會(huì)嘗試將它們轉(zhuǎn)換為相同的類型,但是當(dāng)它們的類型不可轉(zhuǎn)換時(shí),就會(huì)出現(xiàn)這個(gè)錯(cuò)誤。 解決辦法是確保輸入的張量類型與模型的參數(shù)類型相同

    2024年02月15日
    瀏覽(15)
  • 解決Python中ValueError: operands could not be broadcast together with shapes錯(cuò)誤

    解決Python中ValueError: operands could not be broadcast together with shapes錯(cuò)誤 在Python編程中,可能會(huì)遇到類似于“ValueError: operands could not be broadcast together with shapes”的錯(cuò)誤。這種錯(cuò)誤通常與操作數(shù)的形狀不匹配有關(guān)。例如,嘗試對(duì)形狀不同的數(shù)組執(zhí)行運(yùn)算時(shí),就可能會(huì)導(dǎo)致這種錯(cuò)誤的發(fā)

    2023年04月24日
    瀏覽(64)
  • RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the

    RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the

    問題描述: mobilenetv3在殘差塊中加入了注意力機(jī)制?用GPU 進(jìn)行訓(xùn)練時(shí)報(bào)的錯(cuò) 解決方法1: 1,不用GPU 用CPU 就可以 CUDA 設(shè)置為False,確實(shí)可以解決,但是不用GPU 好像意義不大 解決方法2 : 用仍然用GPU ,看下面的的解決方案: 報(bào)錯(cuò)的原因:2 1,我直接在倒殘差塊的前向傳播內(nèi)對(duì)導(dǎo)

    2024年02月16日
    瀏覽(24)
  • Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same

    RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor 錯(cuò)誤原因: 這個(gè)錯(cuò)誤提示表明輸入數(shù)據(jù)的類型和模型權(quán)重的類型不匹配,可能是因?yàn)槟P蜋?quán)重是在GPU上訓(xùn)練的,而輸入數(shù)據(jù)是在CPU上進(jìn)行的。 可以

    2024年02月06日
    瀏覽(15)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

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

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包