Python TensorFlow对象检测API-内存不足
我正在使用Tensorflow对象检测API来训练我自己的对象检测器。我从模型动物园()下载了Python TensorFlow对象检测API-内存不足,python,tensorflow,object-recognition,Python,Tensorflow,Object Recognition,我正在使用Tensorflow对象检测API来训练我自己的对象检测器。我从模型动物园()下载了faster\u rcnn\u inception\u v2\u coco\u 2018\u 01\u 28,并制作了自己的数据集(train.record(~221Mo)、test.record和标签图)对其进行微调 但当我运行它时: python train.py --logtostderr --pipeline_config_path=/home/username/Documents/Object
faster\u rcnn\u inception\u v2\u coco\u 2018\u 01\u 28
,并制作了自己的数据集(train.record(~221Mo)、test.record和标签图)对其进行微调
但当我运行它时:
python train.py --logtostderr --pipeline_config_path=/home/username/Documents/Object_Detection/training/faster_rcnn_inception_v2_coco_2018_01_28/pipeline.config --train_dir=/home/username/Documents/Object_Detection/training/
该进程在填充洗牌缓冲区操作期间被终止,看起来像是OOM问题(16Go RAM)
是否存在减少洗牌缓冲区大小的方法?什么影响它的大小
然后,我添加了一些交换(115Go交换+16Go RAM),填充洗牌缓冲区操作完成,但我的训练在第4步之后完成了所有RAM和交换,而我的train.record大约只有221个月
我已经将这些行添加到我的pipeline.config>train\u config中:
batch_size: 1
batch_queue_capacity: 10
num_batch_queue_threads: 8
prefetch_queue_capacity: 9
将这些文件发送到my pipeline.config>train_input_reader:
queue_capacity: 2
min_after_dequeue: 1
num_readers: 1
接下来呢
我知道我的图像非常(非常)大:每幅25个月,但我只拍摄了9张图像来制作我的train.record(只是为了测试我的安装是否顺利),它不应该如此消耗内存,对吗
关于它为什么使用这么多内存,还有其他想法吗
(顺便说一句,我只使用CPU)图像的数量不是问题。问题在于输入图像的分辨率(在setting.config文件中)。您需要在此处更改高度和宽度值(与.config文件中类似): 设置为较小的值宽度和高度,您将能够完美地训练
queue_capacity: 2
min_after_dequeue: 1
num_readers: 1
image_resizer {
# TODO(shlens): Only fixed_shape_resizer is currently supported for NASNet
# featurization. The reason for this is that nasnet.py only supports
# inputs with fully known shapes. We need to update nasnet.py to handle
# shapes not known at compile time.
fixed_shape_resizer {
height: 1200
width: 1200
}
}