首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SageMaker - mini_batch_size,它是什么,为什么我不能得到它高于5?

SageMaker - mini_batch_size,它是什么,为什么我不能得到它高于5?
EN

Data Science用户
提问于 2021-07-24 13:05:31
回答 1查看 111关注 0票数 0

我正在跟踪本教程,但我一直收到错误:

"The number of input images must be bigger or equal to the mini_batch_size."

我尝试了一系列不同的数据和超参数排列,但是我一直在犯这个错误。

代码语言:javascript
复制
# The algorithm supports multiple network depth (number of layers). They are 18, 34, 50, 101, 152 and 200
# For this training, we will use 18 layers
num_layers = 18
# we need to specify the input image shape for the training data
image_shape = "3,640,640"
# specify the number of output classes
num_classes = 2
# we also need to specify the number of training samples in the training set
num_training_samples = num_classes * 500
# batch size for training
mini_batch_size = 8
# number of epochs
epochs = 1
# learning rate
learning_rate = 0.01
# report top_5 accuracy
top_k = 5
# resize image before training
resize = 640
# period to store model parameters (in number of epochs), in this case, we will save parameters from epoch 2, 4, and 6
checkpoint_frequency = 2
# Since we are using transfer learning, we set use_pretrained_model to 1 so that weights can be
# initialized with pre-trained weights
use_pretrained_model = 0

5似乎是神奇的数字。我很难理解这个问题,以及为什么错误信息似乎与问题不匹配。默认情况是30,教程中说的是128。

目前,类的数量是2,时代是1,因为我试图隔离这个问题。

补充资料:

使用数据增强器生成多个验证映像使我能够提高到10 (到目前为止)。也许验证图像也是相关的?

云锋更多信息

代码语言:javascript
复制
[07/24/2021 12:59:04 ERROR 140201375991616] [12:59:04]
/opt/brazil-pkg-cache/packages/AIAlgorithmsMXNet/AIAlgorithmsMXNet-1.3.x_ecl_Cuda_10.1.x.6753.0/AL2_x86_64/generic-flavor/src/src/io/iter_image_recordio_2.cc:318:
Check failed: !overflow number of input images must be bigger than the batch size
EN

回答 1

Data Science用户

发布于 2021-07-24 19:03:55

你有多少张图片作为输入?也许您还没有像预期的那样加载这些图像(大约30k)。通过获取图像的数量,检查下载过程是否正确。

票数 1
EN
页面原文内容由Data Science提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://datascience.stackexchange.com/questions/98256

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档