【PaddlePaddle系列】報錯解決方法合集 (不定時更新)

1、PaddlePaddle使用CPU時正常運行,但是使用GPU時卻報出一堆錯誤信息,節選如下:

paddle.fluid.core.EnforceNotMet: enforce allocating <= available failed, 1835602936 > 1651048192at [/paddle/paddle/fluid/platform/gpu_info.cc:119]
PaddlePaddle Call Stacks: 
0       0x7f89b8241736p paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int) + 486
1       0x7f89b91f0afep paddle::platform::GpuMaxChunkSize() + 766
2       0x7f89b9120aadp paddle::memory::GetGPUBuddyAllocator(int) + 141
3       0x7f89b9120cbcp void* paddle::memory::Alloc<paddle::platform::CUDAPlace>(paddle::platform::CUDAPlace, unsigned long) + 28

解決方法:

export FLAGS_fraction_of_gpu_memory_to_use=0

避免每次運行或者每個終端都添加一次,可將此按個人喜好添加到用戶級~/.bashrc或系統級/etc/profile

?2、PaddlePaddle使用Fluid版本,使用exe.run時候報錯:

---------------------------------------------------------------------------
EnforceNotMet                             Traceback (most recent call last)
<ipython-input-2-ca8c92bb26a4> in <module>()29         loss = exe.run(fluid.default_main_program(),30                              feed=feeder.feed(data),
---> 31                              fetch_list=[avg_cost])32         print("Pass {0},Loss {1}".format(pass_id,loss))/home/dzqiu/anaconda2/lib/python2.7/site-packages/paddle/fluid/executor.pyc in run(self, program, feed, fetch_list, feed_var_name, fetch_var_name, scope, return_numpy, use_program_cache)441 442         self._feed_data(program, feed, feed_var_name, scope)
--> 443         self.executor.run(program.desc, scope, 0, True, True)444         outs = self._fetch_data(fetch_list, fetch_var_name, scope)445         if return_numpy:EnforceNotMet: enforce y_dims.size() > y_num_col_dims failed, 1 <= 1
The input tensor Y's rank of MulOp should be larger than y_num_col_dims. at [/paddle/paddle/fluid/operators/mul_op.cc:52]
PaddlePaddle Call Stacks: 
0       0x7f3db10d7736p paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int) + 486
1       0x7f3db16da696p paddle::operators::MulOp::InferShape(paddle::framework::InferShapeContext*) const + 2774
2       0x7f3db1f0ef7bp paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&) const + 91
3       0x7f3db1f0c6edp paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&) + 205
4       0x7f3db11734afp paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool) + 255
5       0x7f3db1174500p paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool) + 128

 解決方法:

 在訓練前先執行:exe.run(fluid.default_startup_program())

轉載于:https://www.cnblogs.com/dzqiu/p/9518190.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/279546.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/279546.shtml
英文地址,請注明出處:http://en.pswp.cn/news/279546.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

算法:前K個最大的元素

前幾天&#xff0c;阮一峰 和 winter 在前端九部組織了一個互面小組&#xff0c;目的是為了分享和解答面試遇到的面試題&#xff0c;感興趣的可以了解一下。 下面我就把我回答的一個問題整理出來分享給大家。 問題描述 題目是&#xff1a;算法&#xff0c;前 K 個最大的元素。 …

php表單提交完返回,表單內容不清空解決方法

2019獨角獸企業重金招聘Python工程師標準>>> 我們經常在注冊的時候&#xff0c;填寫一大推信息以后在提交注冊的時候&#xff0c;因為某一項信息不正確&#xff0c;在返回的時候之前的填寫的內容全部沒有了&#xff0c;這樣會導致用戶喪失再次填寫的信息&#xff0c…

es6拼接字符串的方式。

文章&#xff1a;es6拼接字符串的方式。轉載于:https://www.cnblogs.com/Tpf386/p/9519007.html

word標尺灰色_如何在Microsoft Word中使用標尺

word標尺灰色Word’s rulers let you control the margins of your page and the indentation of paragraphs. They’re great for precisely lining up images, text, and other elements. If you’re printing a document, the rulers can help ensure that what you see on …

drools簡單應用

當某個服務的需求經常變的時候&#xff0c;如果使用了硬編碼的方式進行開發會是一件非常麻煩的事。 最近在對項目的積分模塊進行改造的時候想到了規則引擎&#xff0c;使用規則引擎處理復雜而且多變的業務邏輯有其非常大的優勢&#xff0c;包括實時更新、性能等方面。 不多說&a…

31 天重構學習筆記28. 為布爾方法命名

摘要&#xff1a;由于最近在做重構的項目&#xff0c;所以對重構又重新進行了一遍學習和整理&#xff0c;對31天重構最早接觸是在2009年 10月份&#xff0c;由于當時沒有訂閱Sean Chambers的blog&#xff0c;所以是在國外的社區上閑逛的時候鏈接過去的。記得當時一口氣看完了整…

Matplotlib學習---用matplotlib畫誤差線(errorbar)

誤差線用于顯示數據的不確定程度&#xff0c;誤差一般使用標準差&#xff08;Standard Deviation&#xff09;或標準誤差&#xff08;Standard Error&#xff09;。 標準差&#xff08;SD&#xff09;&#xff1a;是方差的算術平方根。如果是總體標準差&#xff0c;那么用σ表示…

關于自增id 你可能還不知道

導讀&#xff1a;在使用MySQL建表時&#xff0c;我們通常會創建一個自增字段(AUTO_INCREMENT)&#xff0c;并以此字段作為主鍵。本篇文章將以問答的形式講述關于自增id的一切。 注&#xff1a; 本文所講的都是基于Innodb存儲引擎。 1.MySQL為什么建議將自增列id設為主鍵&#x…

Android One和Android Go有什么區別?

In 2014, Google announced a lineup of low-cost, low-spec phones called Android One. In 2017, they announced Android Go, specifically designed for low-cost, low-spec phones. So…what’s the difference? 2014年&#xff0c;Google宣布了一系列名為Android One的低…

outlook advanced find 快捷鍵不起作用

癥狀&#xff1a;用戶反應按outlook advanced find的快捷鍵時無效&#xff0c;快捷鍵為CtrlShiftF。第一感覺是肯定跟別的軟件有沖突了&#xff0c;觀察了下&#xff0c;發現用戶正在使用sougou拼音輸入法&#xff0c;于是點其屬性查看&#xff0c;果然發現與其的簡繁切換沖突了…

vue1.0和vue2.0生命周期----整理一

## 1. 作用域區別   1.x 隨意的定義作用域   2.x 不允許body 或者html 元素 ## 2. 生命周期   1.x:     created 實例已經創建     beforeCompile 在編譯之前     compiled 編譯之后     ready 實例已經插入到文檔之中     beforeDetroy 在銷毀之前 …

21-while里的break簡單用法

break是結束循環&#xff0c;break之后、循環體內代碼不再執行。 while True:yn input(Continue(y/n): )if yn in [n,N]:breakprint(running......) 結果輸出&#xff1a; 轉載于:https://www.cnblogs.com/hejianping/p/10861816.html

視頻造假_如何發現“深造假”面部切換視頻

視頻造假Recently, Reddit has been making news again with a subreddit in w hich people use a machine learning tool called “Deep Fake” to automatically replace one person’s face with another in a video. Obviously, since this is the internet, people are us…

C#實現MD5加密

C#實現MD5加密。 1、創建MD5Str.cs加密處理類 [csharp] view plaincopy public class MD5Str { /// <summary> /// 字符串MD5加密 /// </summary> /// <param name"Text">要加密的字符串</param> /// <returns…

【agc004f】Namori Grundy

那個問一下有人可以解釋以下這個做法嘛&#xff0c;看不太懂QwQ~ Description 有一個n個點n條邊的有向圖&#xff0c;點的編號為從1到n。 給出一個數組p&#xff0c;表明有&#xff08;p1&#xff0c;1&#xff09;&#xff0c;&#xff08;p2&#xff0c;2&#xff09;&#x…

找到特定ip地址 修改ip_您如何找到網站的IP地址?

找到特定ip地址 修改ipWhether you are in it just for a bit of geeky fun, or are seriously wanting to know the answer, how do you find out the IP address for a website? Today’s SuperUser Q&A post looks at the answer, and how to know if more than one we…

Rational Rose 2003 下載、破解及安裝方法(圖文)

方法一&#xff1a; 1、安裝Rational Rose2003時&#xff0c;在需選擇安裝項的時候&#xff0c;只選擇Rational Rose EnterPrise Edition即可&#xff0c;不需選擇其他項&#xff0c;之后選擇“DeskTop Installation from CD Image“&#xff0c;一路下一步。出現Mem_pointer_B…

數據結構:莫隊

莫隊算法是用來處理一類無修改的離線區間詢問問題 莫隊的精髓就在于&#xff0c;離線得到了一堆需要處理的區間后&#xff0c;合理的安排這些區間計算的次序以得到一個較優的復雜度 代表題目是BZOJ2038這道題 進行區間詢問[l,r]&#xff0c;輸出該區間內隨機抽兩次抽到相同顏色…

【學習筆記】第三章 python3核心技術與實踐--Jupyter Notebook

可能你已經知道&#xff0c;Python 在 14 年后的“崛起”&#xff0c;得益于機器學習和數學統計應用的興起。那為什么 Python 如此適合數學統計和機器學習呢&#xff1f;作為“老司機”的我可以肯定地告訴你&#xff0c;Jupyter Notebook &#xff08;https://jupyter.org/&…

二進制安位處理_處理器與安??全性之間的聯系是什么?

二進制安位處理Newer processors are able to contribute to the security of your system, but what exactly do they do to help? Today’s Super User Q&A post looks at the link between processors and system security. 較新的處理器能夠為您的系統安全做出貢獻&am…