【发布时间】:2018-02-09 08:53:07
【问题描述】:
我正在关注以下 TensorFlow 对象检测教程
Tensorflow Object Detection。我已经从以下 GitHub 链接 Object Models 下载了模型。我正在尝试使用自定义数据检测花朵。 TFRecords 和标签都已创建,当我运行 train.py 时,如上面的教程所示
python train.py --logtostderr --train_dir=training\ --pipeline_config_path=training\ssd_mobilenet_v1_pets.config.
我收到以下错误:
Instructions for updating:
Please switch to tf.train.create_global_step
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:Summary name /clone_loss is illegal; using clone_loss instead.
2018-02-09 01:45:59.841297: I C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\35\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX
INFO:tensorflow:Restoring parameters from ssd_mobilenet_v1_coco_11_06_2017/model.ckpt
INFO:tensorflow:Starting Session.
INFO:tensorflow:Saving checkpoint to path training\model.ckpt
INFO:tensorflow:Starting Queues.
INFO:tensorflow:global_step/sec: 0
INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.ResourceExhaustedError'>, OOM when allocating tensor with shape[24,1,3648,5472,3]
[[Node: batch = QueueDequeueManyV2[component_types=[DT_STRING, DT_INT32, DT_FLOAT, DT_INT32, DT_FLOAT, DT_INT32, DT_INT64, DT_INT32, DT_INT64, DT_INT32, DT_INT64, DT_INT32, DT_BOOL, DT_INT32, DT_FLOAT, DT_INT32, DT_STRING, DT_INT32, DT_STRING, DT_INT32], timeout_ms=-1, _device="/job:localho
st/replica:0/task:0/device:CPU:0"](batch/padding_fifo_queue, batch/n)]]
INFO:tensorflow:Caught OutOfRangeError. Stopping Training.
INFO:tensorflow:Finished training! Saving model to disk.
INFO:tensorflow:Recording summary at step 0.
Traceback (most recent call last):
File "train.py", line 164, in <module>
tf.app.run()
File "C:\Users\ML\AppData\Local\Programs\Python\Python35\lib\site-packages \tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "train.py", line 160, in main
worker_job_name, is_chief, FLAGS.train_dir)
File "C:\Users\Ashwin\Desktop\game making\OpenCV\Tensorflow Object Detection\models\research\object_detection\trainer.py", line 332, in train
saver=saver)
File "C:\Users\Ashwin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\slim\python\slim\learning.py", line 775, in train
sv.stop(threads, close_summary_writer=True)
File "C:\Users\Ashwin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\training\supervisor.py", line 792, in stop
stop_grace_period_secs=self._stop_grace_secs)
File "C:\Users\Ashwin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\training\coordinator.py", line 389, in join
six.reraise(*self._exc_info_to_raise)
File "C:\Users\Ashwin\AppData\Local\Programs\Python\Python35\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Ashwin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\training\queue_runner_impl.py", line 238, in _run
enqueue_callable()
File "C:\Users\Ashwin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\client\session.py", line 1231, in _single_operation_run
target_list_as_strings, status, None)
File "C:\Users\Ashwin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 473, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[24,1,3648,5472,3]
[[Node: batch = QueueDequeueManyV2[component_types=[DT_STRING, DT_INT32, DT_FLOAT, DT_INT32, DT_FLOAT, DT_INT32, DT_INT64, DT_INT32, DT_INT64, DT_INT32, DT_INT64, DT_INT32, DT_BOOL, DT_INT32, DT_FLOAT, DT_INT32, DT_STRING, DT_INT32, DT_STRING, DT_INT32], timeout_ms=-1, _device="/job:localho
st/replica:0/task:0/device:CPU:0"](batch/padding_fifo_queue, batch/n)]]
这些行似乎表明了错误的性质:
INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.ResourceExhaustedError'>, OOM when allocating tensor with shape[24,1,3648,5472,3]
INFO:tensorflow:Caught **OutOfRangeError**. Stopping Training.
我查看了 GitHub 页面,其中删除 num_epochs 似乎可以修复 OutOfRange 错误,但我在从 repo 下载的 train.py 中找不到此类参数。这是我第一次接触 TensorFlow,我无法完全理解其中的机制。
我的数据集标签大小是:训练标签中的 124 张图像和测试标签中的 93 张图像。
【问题讨论】:
-
如果您的 GPU 上没有足够的内存来容纳整个测试数据,您可以将其分小批提供给评估图
-
我只是想知道... 124 个训练图像会使您的计算机内存不足。它可以有多小?
-
@Straw:Inter i7 2,4ghz 和 8GB RAM,你想知道它的小吗?
标签: python python-3.x tensorflow deep-learning