【问题标题】:Training on a big set of high-res pictures with turicreate out of memory使用 turicreate 对大量高分辨率图片进行训练
【发布时间】:2018-11-24 20:10:24
【问题描述】:

我正在尝试使用 Turicreate 在大约 150 张非常高分辨率的图片(每张 4Mb,3000X5000)上训练模型。 我跑了

model = tc.object_detector.create(train_data, max_iterations=10)

一段时间后,我收到“虚拟内存不足”警告,并且在我的计算机卡住之后。

我想知道在这样一批图片上进行训练的最佳做法是什么。

我正在使用的完整代码:

import turicreate as tc
data =  tc.SFrame('annotations.sframe')
train_data, test_data = data.random_split(0.8)
model = tc.object_detector.create(train_data, max_iterations=10)
predictions = model.predict(test_data)
metrics = model.evaluate(test_data)
model.save('mymodel.model')
model.export_coreml('MyCustomObjectDetector.mlmodel')

【问题讨论】:

    标签: image-processing computer-vision turi-create


    【解决方案1】:

    通常您希望减小批量大小,即训练数据的一部分用于一次迭代。显然这在 Turicreate 中还不容易调整,所以看起来该程序正在使用一个时期的完整数据集。理想情况下,您希望使用较小的部分,例如 32 或 64 个图像。在 Github 上有一些关于该主题的讨论,显然批量大小作为公共参数可能会在未来的某个版本中出现。

    3000 x 5000 对于这种工作来说也相当大。您可能希望缩小图像的大小,即通过使用在例如 Scipy 中实现的双三次插值。根据您正在处理的图像类型,即使每个维度缩小 10 倍也可能不会太大。

    【讨论】:

      【解决方案2】:

      将数据集图像的大小例如减小到(宽度:400 高度:300),并将 max_iterations 提高到至少 1000。

      【讨论】:

        猜你喜欢
        • 2017-11-22
        • 1970-01-01
        • 2020-06-03
        • 2011-06-12
        • 2019-12-08
        • 2018-10-04
        • 2014-11-20
        • 2020-10-28
        • 2012-12-10
        相关资源
        最近更新 更多