无法在自定义数据集

时间:2018-01-24 10:01:00

标签: python-3.x tensorflow

我正在尝试在我自己的对象上训练ssd_mobilenet_v1_coco_2017_11_17模型(BournVita,如果你想谷歌它)。图像大小不一,并使用labelImg标记 我正在关注可以找到here的Sentdex教程,但是在Windows 10上 我有一个与tensorflow版本1.4.0,Python 3.5.3和OpenCV 3链接的Nvidia 1050Ti GPU。

情况:
执行时

python path\to\train.py --logtostderr --train-dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_pets.config

我收到以下错误:

(.dl-env) D:\Work\Gemini\bournvita>python D:\Work\.dl-env\Lib\site-packages\tensorflow\models\research\object_detection\train.py --logtostderr --train_dir=training\ --pipeline_config_path=training\ssd_mobilenet_v1_pets.config
WARNING:tensorflow:From D:\Work\.dl-env\lib\site-packages\object_detection-0.1-py3.5.egg\object_detection\trainer.py:210: create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version.
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-01-24 15:04:57.969803: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\35\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
2018-01-24 15:04:59.246153: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\35\tensorflow\core\common_runtime\gpu\gpu_device.cc:1030] Found device 0 with properties:
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.62
pciBusID: 0000:01:00.0
totalMemory: 4.00GiB freeMemory: 3.31GiB
2018-01-24 15:04:59.246358: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\35\tensorflow\core\common_runtime\gpu\gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
INFO:tensorflow:Restoring parameters from training\model.ckpt-5
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: , image_size must contain 3 elements[4]
         [[Node: cond_1/RandomCropImage/sample_distorted_bounding_box/SampleDistortedBoundingBoxV2 = SampleDistortedBoundingBoxV2[T=DT_INT32, area_range=[0.1, 1], aspect_ratio_range=[0.5, 2], max_attempts=100, seed=0, seed2=0, use_image_if_no_bounding_boxes=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](cond_1/RandomCropImage/Shape, cond_1/RandomCropImage/ExpandDims, cond_1/RandomCropImage/PruneNonOverlappingBoxes/Const)]]
INFO:tensorflow:Caught OutOfRangeError. Stopping Training.
INFO:tensorflow:Finished training! Saving model to disk.
INFO:tensorflow:Recording summary at step 5.
Traceback (most recent call last):
  File "D:\Work\.dl-env\Lib\site-packages\tensorflow\models\research\object_detection\train.py", line 163, in 
    tf.app.run()
  File "D:\Work\.dl-env\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "D:\Work\.dl-env\Lib\site-packages\tensorflow\models\research\object_detection\train.py", line 159, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "D:\Work\.dl-env\lib\site-packages\object_detection-0.1-py3.5.egg\object_detection\trainer.py", line 332, in train
    saver=saver)
  File "D:\Work\.dl-env\lib\site-packages\tensorflow\contrib\slim\python\slim\learning.py", line 775, in train
    sv.stop(threads, close_summary_writer=True)
  File "D:\Work\.dl-env\lib\site-packages\tensorflow\python\training\supervisor.py", line 792, in stop
    stop_grace_period_secs=self._stop_grace_secs)
  File "D:\Work\.dl-env\lib\site-packages\tensorflow\python\training\coordinator.py", line 389, in join
    six.reraise(*self._exc_info_to_raise)
  File "D:\Work\.dl-env\lib\site-packages\six.py", line 693, in reraise
    raise value
  File "D:\Work\.dl-env\lib\site-packages\tensorflow\python\training\queue_runner_impl.py", line 238, in _run
    enqueue_callable()
  File "D:\Work\.dl-env\lib\site-packages\tensorflow\python\client\session.py", line 1231, in _single_operation_run
    target_list_as_strings, status, None)
  File "D:\Work\.dl-env\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.InvalidArgumentError: image_size must contain 3 elements[4]
         [[Node: cond_1/RandomCropImage/sample_distorted_bounding_box/SampleDistortedBoundingBoxV2 = SampleDistortedBoundingBoxV2[T=DT_INT32, area_range=[0.1, 1], aspect_ratio_range=[0.5, 2], max_attempts=100, seed=0, seed2=0, use_image_if_no_bounding_boxes=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](cond_1/RandomCropImage/Shape, cond_1/RandomCropImage/ExpandDims, cond_1/RandomCropImage/PruneNonOverlappingBoxes/Const)]]

最后一行可能很重要。

我尝试将所有图片更改为jpg,但无济于事。我也咨询了this页面,但它没有多大帮助。谢谢你的帮助。

0 个答案:

没有答案