自定义对象训练 Tensor-flow 错误

Custom Object Training Tensor-flow Error

我想根据我的研究训练一组图像。遵循本教程最终会出现错误。这是我正在关注的教程。 Tutorial

我在 python 3.6、最新的 tensorflow 及其 CPU 版本中实施这个项目,而我 运行 根据它给出的教程执行训练模型像这样的错误。

    Instructions for updating:
    Please switch to tf.train.create_global_step
    INFO:tensorflow:Scale of 0 disables regularizer.
    INFO:tensorflow:Scale of 0 disables regularizer.
    INFO:tensorflow:depth of additional conv before box predictor: 0
    WARNING:tensorflow:From C:\tensorflow1\models\research\object_detection\core\box_predictor.py:403: calling reduce_mean (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
    Instructions for updating:
    keep_dims is deprecated, use keepdims instead
    INFO:tensorflow:Scale of 0 disables regularizer.
    WARNING:tensorflow:From C:\tensorflow1\models\research\object_detection\core\losses.py:317: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.
    Instructions for updating:

    Future major versions of TensorFlow will allow gradients to flow
    into the labels input on backprop by default.

    See @{tf.nn.softmax_cross_entropy_with_logits_v2}.

    Traceback (most recent call last):
      File "train.py", line 167, in <module>
        tf.app.run()
      File "C:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run
        _sys.exit(main(argv))
      File "train.py", line 163, in main
        worker_job_name, is_chief, FLAGS.train_dir)
      File "C:\tensorflow1\models\research\object_detection\trainer.py", line 284, in train
        train_config.optimizer)
      File "C:\tensorflow1\models\research\object_detection\builders\optimizer_builder.py", line 50, in build
        learning_rate = _create_learning_rate(config.learning_rate)
      File "C:\tensorflow1\models\research\object_detection\builders\optimizer_builder.py", line 109, in _create_learning_rate
        learning_rate_sequence, config.warmup)
      File "C:\tensorflow1\models\research\object_detection\utils\learning_schedules.py", line 156, in manual_stepping
        raise ValueError('First step cannot be zero.')
    ValueError: First step cannot be zero.

为什么我会收到这种错误?请帮我解决这个问题。

我在这里找到了解决方法:

https://github.com/tensorflow/models/issues/3794

基本上,将此代码从您的 training/faster_rcnn_inception_v2_pets.config(或您命名的任何文件)文件中取出:

schedule {
   step: 0
   learning_rate: .0001
}

如果您正在寻找确切的文本,您可能找不到它,在我的代码中它是 learning_rate: .0002。总之,希望对你有帮助。