一次可以传给Caffe多少图片? [英] How many images can you pass to Caffe at a time?

查看:193
本文介绍了一次可以传给Caffe多少图片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到了Caffe MNIST如何示例prototxt文件允许最多64个图像一次传递到网络。

我可以设置这个数字有多高?

我可以(例如)将此数字设置为200或甚至500,以便我一次可以接受高达200/500的图像,而不会对预测产生负面影响。

I noticed how the Caffe MNIST example prototxt file allows for up to 64 images to be passed to the network at a time.
Is there a limit for how high I can set this number?
Could I (for example) set this number to 200 or even 500 so that I can accept up to 200/500 images at a time without it impacting the predictions negatively?

推荐答案

唯一的限制是你的机器内存:当caffe加载模型时,它为所有参数和所有中间数据blob分配内存。您同时处理的图片越多,您需要预先分配的内存越大。

确定此数字的最简单(最粗糙)的方法是简单的拖尾错误,请尝试将其设置为200,加载模型时是否会出现内存不足错误。

请注意,您可以同时处理的图像数量还取决于您使用的是GPU还是CPU:通常是GPU内存小于CPU内存,因此可以处理较少的图像。

The only limit is your machine's memory: When caffe loads the model it allocates memory for all the parameters and all the intermediate data blobs. The more images you process concurrently, the larger the memory you need to allocate in advance.
The easiest (and crudest) way of determining this number is simply trail-and-error, try setting it to 200 and see if you get an "out of memory" error when loading the model.
Note that the number of images you can process at the same time depends also on whether you are using GPU or CPU: usually GPU memory is smaller than CPU memory and thus allows you to process fewer images.

这篇关于一次可以传给Caffe多少图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆