【问题标题】:Custom Object Training Tensor-flow Error自定义对象训练张量流错误
【发布时间】:2018-10-16 15:26:54
【问题描述】:

我想根据我的研究训练一组图像。按照本教程结束时会出现错误。这是我正在关注的教程。 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.

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

【问题讨论】:

    标签: python opencv tensorflow object-detection-api


    【解决方案1】:

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

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

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

    schedule {
       step: 0
       learning_rate: .0001
    }
    

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

    【讨论】:

      猜你喜欢
      • 2021-01-02
      • 2018-12-21
      • 1970-01-01
      • 2021-12-24
      • 2019-02-12
      • 1970-01-01
      • 2021-07-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多