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

【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。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

import torchvision.models as models
self.backbone = models.resnet101(pretrained=True) #舊版本寫法

報錯內(nèi)容:

C:\Users\ting\anaconda3\envs\pytorch\python.exe C:\Users\Administrator\PycharmProjects\FCN\model\fcn_res101.py 
C:\Users\ting\anaconda3\envs\pytorch\lib\site-packages\torchvision\models\_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
  warnings.warn(
C:\Users\ting\anaconda3\envs\pytorch\lib\site-packages\torchvision\models\_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=ResNet101_Weights.IMAGENET1K_V1`. You can also use `weights=ResNet101_Weights.DEFAULT` to get the most up-to-date weights.
  warnings.warn(msg)
torch.Size([1, 21, 256, 256])

Process finished with exit code 0

翻譯一下,就是參數(shù)列表中的pretrained在新版本中被棄了,要使用weights這個參數(shù)。然后教你用新的參數(shù)。

就按照watning里寫的把models.resnet101()后面的內(nèi)容重新設置就好。


第一種:weights = models.ResNet101_Weights.DEFAULT

userwarning: the parameter 'pretrained' is deprecated since 0.13 and may be,pytorch,bug,深度學習,pytorch,人工智能

import torchvision.models as models
self.backbone = models.resnet101(weights = models.ResNet101_Weights.DEFAULT)

輸出結(jié)果:?

C:\Users\ting\anaconda3\envs\pytorch\python.exe C:\Users\Administrator\PycharmProjects\FCN\model\fcn_res101.py 
Downloading: "https://download.pytorch.org/models/resnet101-cd907fc2.pth" to C:\Users\Administrator/.cache\torch\hub\checkpoints\resnet101-cd907fc2.pth
100%|██████████| 171M/171M [00:42<00:00, 4.17MB/s]
torch.Size([1, 21, 256, 256])

Process finished with exit code 0

第二種:weights = models.ResNet101_Weights.IMAGENET1K_V1

userwarning: the parameter 'pretrained' is deprecated since 0.13 and may be,pytorch,bug,深度學習,pytorch,人工智能

import torchvision.models as models
self.backbone = models.resnet101(weights = models.ResNet101_Weights.IMAGENET1K_V1)

?輸出結(jié)果:

C:\Users\ting\anaconda3\envs\pytorch\python.exe C:\Users\Administrator\PycharmProjects\FCN\model\fcn_res101.py 
torch.Size([1, 21, 256, 256])

Process finished with exit code 0

res101中weight官方解釋文章來源地址http://www.zghlxwxcb.cn/news/detail-548676.html

到了這里,關于【warning】UserWarning: The parameter ‘pretrained‘ is deprecated since 0.13 and may be removed的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

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

領支付寶紅包贊助服務器費用

相關文章

  • UserWarning: __floordiv__is deprecated, and its behavior will change in a future version of pytorch.

    UserWarning: __floordiv__is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the ‘trunc’ function NOT ‘floor’). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode=‘trunc’), or for actual floor division, use torch.div(a,

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

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

    ?錯誤:[Vue warn]: 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: \\\"value\\\". 譯文:[Vue警告]:避免直接改變prop,因為每當父組件重新呈現(xiàn)時,該值將被覆蓋。相反,應該使用基于

    2024年02月12日
    瀏覽(19)
  • [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

    報錯翻譯:避免直接更改一個prop,因為每當父組件重新渲染時,該值都會被覆蓋。相反,應使用基于prop值的數(shù)據(jù)或計算屬性。正在更改的prop:“activeId” 解決辦法,使用基于prop的值,即把名為activeId的prop的值放在另一個變量中,對那個變量進行修改,不修改activeId。 1、實

    2024年02月03日
    瀏覽(30)
  • Warning: [antd: Tabs] Tabs.TabPane is deprecated. Please use `items` directly.

    Warning: [antd: Tabs] Tabs.TabPane is deprecated. Please use items directly. 控制臺報錯 Warning: [antd: Tabs] Tabs.TabPane is deprecated. Please use items directly. https://ant.design/components/tabs/ Usage upgrade after 4.23.0# antd tabs組件 在 4.23.0 版本上做了更新

    2024年02月14日
    瀏覽(18)
  • warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME

    warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME

    elasticsearch-7.15.2啟動時警告信息: 1 \\\"warning:?usage?of?JAVA_HOME?is?deprecated,?use?ES_JAVA_HOME\\\" 譯文的含義是指“警告:不推薦使用JAVA_HOME,請使用ES_JAVA_HOME”。 elasticsearch 7系列版本以上都是自帶的jdk,可以在es的bin目錄下找到elasticsearch-env.bat這個文件,配置es的jdk。官方推薦使用e

    2024年02月16日
    瀏覽(22)
  • ElasticSearch--warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME

    es和jdk是一個強依賴的關系,所以當我們在新版本的ElasticSearch壓縮包中包含有自帶的jdk,但是當我們的Linux中已經(jīng)安裝了jdk之后,就會發(fā)現(xiàn)啟動es的時候優(yōu)先去找的是Linux中已經(jīng)裝好的jdk,此時如果jdk的版本不一致,就會造成jdk不能正常運行,報錯如下: warning: usage of JAVA_HOM

    2024年02月06日
    瀏覽(46)
  • [AxiosError]: There is no suitable adapter to dispatch the request since :- adapter xhr is not suppo

    [AxiosError]: There is no suitable adapter to dispatch the request since :- adapter xhr is not suppo

    最近在寫一個node項目時,webpack打包之后運行打包的js文件報錯: ?[AxiosError]: There is no suitable adapter to dispatch the request since : - adapter xhr is not supported by the environment - adapter http is not available in the build ? ? at we (C:UserslzzDocuments網(wǎng)盤腳本distbundle.js:2:32230) ? ? at Ce.Se (C:Userslzz

    2024年02月03日
    瀏覽(26)
  • Warning: Calling formula.plist_path is deprecated. Use formula.launchd_service_path instead.

    Warning: Calling formula.plist_path is deprecated. Use formula.launchd_service_path instead.

    Homebrew 的使用之旅 今天在使用 brew services list 指令的時候,輸出一直含有警告內(nèi)容??: 雖然不影響使用,但是卻不太“優(yōu)雅”。 這個警告是因為在 Homebrew 2.6.0 版本中, formula.plist_path 屬性已被棄用,替代方法是使用 formula.launchd_service_path 屬性。如果你的 Homebrew 版本較舊,

    2023年04月09日
    瀏覽(32)
  • elasticsearch啟動警告的修復方案 warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME“

    elasticsearch啟動警告的修復方案 warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME“

    最近在搞skywalking,在windows10 上進行skywalking功能初步的驗證,部署應用版本信息如下: jdk1.8(windows上的JAVA_HOME)+oap 9.3.0 +es7.11 在環(huán)境搭建之前查閱相關資料說明es7要求最低的java版本是 11并且自身攜帶jdk。 (目錄:elasticsearch-7.17.0jdk)es7運行時無需關注系統(tǒng)本身的jdk版本問

    2024年03月18日
    瀏覽(216)
  • 【Android】The ‘kotlin-android-extensions‘ Gradle plugin is deprecated

    最近跑編譯的時候,經(jīng)常有個警告 意思是說 kotlin-android-extensions 已經(jīng)廢棄了,讓我用 kotlin-parcelize 在 build.gradle 中需要如下修改:

    2024年02月11日
    瀏覽(23)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

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

二維碼1

領取紅包

二維碼2

領紅包