11
votes

I am new here. I recently started working with object detection and decided to use the Tensorflow object detection API. But, when I start training the model, it does not display the global step like it should, although it's still training in the background.

Details: I am training on a server and accessing it using OpenSSH on Windows. I trained a custom dataset, by collecting pictures and labeling them. I trained it using model_main.py. Also, until a couple of months back, the API was a little different, and only recently they changed to the latest version. For instance, earlier it used to use train.py for training, instead of model_main.py. All the online tutorial I can find use train.py, so it might be a problem with the latest commit. But I don't find anyone else fining this problem.

Thanks in advance!

3
Welcome to the site. It is indeed a bit difficult to help with limited information. You could try to read How do I ask a good question? from the Help center.user2653663
If you use putty kind of a client and invoke the train.py from the putty you will be able to see the steps and progressSrinivas Bringu
@SrinivasBringu Hi, thanks for the reply. I am using openSSH on windows. And it's still not showing the steps. Also, it no more uses train.py, they changed their API and it used model_main.py now.Aditya Singh
@user2653663 I added more details!Aditya Singh
Thanks for this amazing question!!! i've been wasting quite a lot of time thinking training is not happeningPiyal George

3 Answers

15
votes

Add tf.logging.set_verbosity(tf.logging.INFO) after the import section of the model_main.py script. It will display a summary after every 100th step.

11
votes

As Thommy257 suggested, adding tf.logging.set_verbosity(tf.logging.INFO) after the import section of model_main.py prints the summary after every 100 steps by default.

Further, to specify the frequency of the summary, change

config = tf.estimator.RunConfig(model_dir=FLAGS.model_dir)

to

config = tf.estimator.RunConfig(model_dir=FLAGS.model_dir, log_step_count_steps=k)

where it will print after every k steps.

2
votes

Regarding the recent change to model_main , the previous version is available at the folder "legacy". I use train.py and eval.py from this legacy folder with the same functionality as before.