- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在开始训练我的对象检测 Tensorflow 2.5 GPU 模型时遇到资源耗尽错误。我使用了 18 张训练图像和 3 张测试图像。我使用的预训练模型是来自 Tensorflow zoo 2.2 的 Faster R-CNN ResNet101 V1 640x640 模型。我正在使用带有 8 GB 专用内存的 Nvidia RTX 2070 来训练我的模型。
令我感到困惑的是,为什么训练过程在训练集如此小的情况下会占用我的 GPU 如此多的内存。这是我与错误相处的GPU内存总结:
Limit: 6269894656
InUse: 6103403264
MaxInUse: 6154866944
NumAllocs: 4276
MaxAllocSize: 5786902272
Reserved: 0
PeakReserved: 0
LargestFreeBlock: 0
我还将训练数据的批量大小减少到 6,测试数据的批量大小减少到 1。
最佳答案
我在所有在 gpu 上运行的笔记本中使用下面的代码,以防止此类错误:
import tensorflow as tf
gpus = tf.config.list_physical_devices('GPU')
if gpus:
try:
# Currently, memory growth needs to be the same across GPUs
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, True)
logical_gpus = tf.config.list_logical_devices('GPU')
print(len(gpus), "Physical GPUs,", len(logical_gpus), "Logical GPUs")
except RuntimeError as e:
# Memory growth must be set before GPUs have been initialized
print(e)
By default, TensorFlow maps nearly all of the GPU memory of all GPUs (subject to CUDA_VISIBLE_DEVICES) visible to the process.
More information about using gpu with tensorflow here
也许它会解决错误
希望对你有帮助
关于tensorflow - 获取错误 "Resource exhausted: OOM when allocating tensor with shape[1800,1024,28,28] and type float on/job:localhost/...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69545763/
在我的 spring mvc 应用程序中,我使用 Atomikos Transaction API (v3.9.3) 和 JPA(Hibernate 作为供应商)。我有两个实体管理器连接到两个数据源。
我正在对在某个时候挂起的 WCF 服务进行故障排除。 服务行为如下: [ServiceBehavior( InstanceContextMode = InstanceContextMode.PerCa
我有一个很大的项目(并且已经在 Windows 上运行),我正在尝试在 Delphi RIO 10.3.3 中编译为 Android 32/64 位 当构建到 RELEASE 配置时,它确实编译成功。
我想利用 Scala 在缺少匹配项时发出的警告(“不详尽”),这样我就不会忘记一个(我有几十个)。以下简化示例显示了我的尝试: sealed case class MESSAGE() class SU
我正在尝试使用复杂的if-else决策树来实现GLSL片段着色器。不幸的是,着色器编译器很早就失败,并出现“语法错误-内存耗尽”错误。 GLSL中的代码大小或决策树深度是否有任何限制?有什么建议如何克
这不是关于使用 famous 在链表中检测循环的问题龟兔赛跑法。 在 Hare & Tortoise 方法中,我们有指针以 1x 和 2x 的速度运行以确定它们是否相遇,我相信这是最有效的方法,这种搜
我的 JDBC 代码有问题。这是相关代码: /** method for checking password into the Oracle database */ public String Che
下面的代码在函数 asd 中产生了一个“非穷举模式” data Token = TokenPlus | TokenMinus | TokenMal
所以我有这个小片段: const useTest = (callbackFunc) => { const user = useSelector(selector.getUser); // a
我试图了解 -XX:G1ReservePercent实际上确实如此。我在 official documentation 中找到的描述不是很全面: Sets the percentage of rese
考虑以下代码片段: sealed abstract class Bar object B1 extends Bar object B2 extends Bar object B3 extends Ba
我的代码是: Statement testSt = null; ResultSet rset = null; String query = "selec
所以我有这个功能,当我尝试像这样使用它时:合并排序列表 [1,1] [1,1]它给了我一个错误: [1,1*** Exception: SortFunctions.hs:(86,1)-(91,89):
import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import j
我正在尝试在 Linux 中使用 qcc 在 QNX Momentics IDE (4.6) 中构建一个项目。我未能成功构建过程并出现以下错误: virtual memory exhausted: C
我收到错误 java.sql.SQLException: Exhausted ResultSet 来对 Oracle 数据库运行查询。该连接是通过 Websphere 中定义的连接池进行的。执行的代码
(apply #'+ (loop for i from 1 to x collect 1)) 如果x的值为253391,则有效,但(SB-KERNEL::CONTROL-STACK-EXHAUSTED
有谁知道如何解决这个错误?我在 macbook pro 中使用 R。 我正在使用一个名为 rsgcc 的集群包 thm sessionInfo() R version 2.15.2 (2012-10
尝试创建一个从列表中删除重复项并将其替换为单个元素的函数。不断收到错误消息“已删除函数中的非详尽模式”。我认为这意味着我的模式匹配缺少可能的情况?我想我已经涵盖了所有的可能性。我对 Haskell 很
初学者 Haskell 问题。实际上我发现了非常相似的问题Haskell error: "non-exhaustive patterns" 交互式外壳: Prelude> merge [] [] =
我是一名优秀的程序员,十分优秀!