question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error First step cannot be zero when running train.py

See original GitHub issue

i tried to use the same images (card) provided, i just delete all the processed file (csv,dll) and follow all the step. And when i tried to issue python train.py I got this error

Traceback (most recent call last):
  File "train.py", line 184, in <module>
    tf.app.run()
  File "C:\Users\MRCPP-Fablab\AppData\Local\conda\conda\envs\tensorflow\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run
    _sys.exit(main(argv))
  File "train.py", line 180, in main
    graph_hook_fn=graph_rewriter_fn)
  File "E:\tensor\models\research\object_detection\trainer.py", line 288, in train
    train_config.optimizer)
  File "E:\tensor\models\research\object_detection\builders\optimizer_builder.py", line 50, in build
    learning_rate = _create_learning_rate(config.learning_rate)
  File "E:\tensor\models\research\object_detection\builders\optimizer_builder.py", line 109, in _create_learning_rate
    learning_rate_sequence, config.warmup)
  File "E:\tensor\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.

Any clues why this happen?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:20

github_iconTop GitHub Comments

30reactions
blockhuntscommented, Jun 4, 2018

yes, edit this in your config file in …\models\research\object_detection\training

train_config: {
  batch_size: 1
  optimizer {
    momentum_optimizer: {
      learning_rate: {
        manual_step_learning_rate {
          initial_learning_rate: 0.0002
          schedule {
            step: 900000
            learning_rate: .00002
          }
          schedule {
            step: 1200000
            learning_rate: .000002
          }
        }
      }
      momentum_optimizer_value: 0.9
    }
    use_moving_average: false
  }
2reactions
jim-meyercommented, Jun 30, 2018

I see that epratheeban has the solution to my problem mentioned here https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10/issues/11:

It’s easy. Go to the utils folder. Find the learning_schedules.py file. Go to the line 167. And replace the line 167 with below

rate_index = tf.reduce_max(tf.where(tf.greater_equal(global_step, boundaries), list(range(num_boundaries)), [0] * num_boundaries))

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Object Training Tensor-flow Error - Stack Overflow
') ValueError: First step cannot be zero. Why i`m getting this kind of a error? please help me to fix this.
Read more >
Your First Deep Learning Project in Python with Keras Step-by ...
Keras Tutorial: Keras is a powerful easy-to-use Python library for developing and evaluating deep learning models. Develop Your First Neural ...
Read more >
How to Train YOLO v5 on a Custom Dataset - Paperspace Blog
This tutorial will show you how to implement and train YOLOv5 on your own custom dataset. Full Python code included.
Read more >
Troubleshooting | AI Platform Training - Google Cloud
The first step of troubleshooting an error is typically to examine the logs ... Python automatically returns zero on successful completion, and returns...
Read more >
How to train an object detection model easy for free - DLology
We'r getting this error:"No module named 'object_detection'" while we' re running this command:python generate_tfrecord.py --csv_input=data/annotations/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found