【问题标题】:Tensorflow 2 Object Detection API: Can't set batchsize to 1Tensorflow 2 对象检测 API:无法将批量大小设置为 1
【发布时间】:2023-04-07 14:32:01
【问题描述】:

如果我将batchsize 更改为1,并以更快的RCNN 640x640ResNet 50 作为主干,

我收到以下错误:

The 'global_batch_size' 1 is not divisible by 'num_replicas_in_sync' 4
How can I set the batchsize to 1?

【问题讨论】:

    标签: tensorflow tensorflow2.0 tensorflow2.x


    【解决方案1】:

    正如您可能想象的那样,您的问题是您实际上正在尝试使用 4 个视频卡/设备 (num_replicas_in_sync),但您的 batch_size 为 1。不用说,您无法使用 1 个批量大小进行训练在 4 台设备上使用。

    有两种解决方案:

    1. 要么将 num_replicas_in_sync 更改为 1。
    2. 要么将global_batch_size 增加到可被 4 整除的值(4、8、12 等)

    【讨论】:

      猜你喜欢
      • 2021-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多