models icon indicating copy to clipboard operation
models copied to clipboard

model_main.py Stuck Periodically

Open Cavan09 opened this issue 7 years ago • 5 comments

System information

  • What is the top-level directory of the model you are using: Object Detection
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): I've only customized some of the scripts to generate my own data sets
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10 Pro x64
  • TensorFlow installed from (source or binary): Installed from Binary
  • TensorFlow version (use command below): Version 1.12
  • Bazel version (if compiling from source): 0.17.2
  • CUDA/cuDNN version: cudnn version 7.xx (I believe 7.31)
  • GPU model and memory: RTX 2080 ti 11GBs
  • Exact command to reproduce:

model_main.py --logtostderr --model_dir=......\runs\HyperParameterTuning\AnchorPoints\training --pipeline_config_path=......\runs\HyperParameterTuning\AnchorPoints\training\pipeline.config --num_train_steps=50000

Describe the problem

I have been using the legacy train.py for a while and decided to switch over to model_main.py as train.py was deprecated.

While running model_main.py the training will pause indefinitely which seems to occur when a checkpoint is being saved. The only way through is to press ctrl+c and it will resume. This doesn't seem to cause any problems with training or evaluating, but it does make it hard to run in the background.

I have added tf.logging.set_verbosity(tf.logging.INFO) to see the output while training.

I am currently using the model faster_rcnn_inception_resnet_v2_atrous_coco for training. My batch size is set to 1, and I'm using a value of 1 for sample_1_of_n_eval_examples. My evaluation batch size is also 1.

Example of the logs during the freeze image

After pressing ctrl + c image

Cavan09 avatar Mar 19 '19 14:03 Cavan09

I've got a similar problem with model_main. It randomly stops, it doesn't stuck but it stops after one or two checkpoints. I have no problems with the legacy train.py

JoseLuisFriedrich avatar Mar 20 '19 22:03 JoseLuisFriedrich

So I ran it perfectly fine last night when I didn't run tensorboard at the same time. I'm not sure if tensorboard is causing the problem or if maybe the total memory consumption is the fault. Either way, I still don't have a defined answer.

Cavan09 avatar Mar 21 '19 14:03 Cavan09

I solved it by changing the save_checkpoints_secs from default 10 minute to 30 minutes of following file python3.6/site-packages/tensorflow_estimator/python/estimator/run_config.py

489     if (save_checkpoints_steps == _USE_DEFAULT and
490         save_checkpoints_secs == _USE_DEFAULT):
491       save_checkpoints_steps = None
492       # updated to 30 minute
493       #save_checkpoints_secs = 600
494       save_checkpoints_secs = 60*30

prempatra avatar Apr 16 '19 04:04 prempatra

One possible reason is that the eval set is too large, and a eval set with only a few dozen images will be work well.

yaoqingyuan avatar Apr 30 '19 07:04 yaoqingyuan

Hi There, We are checking to see if you still need help on this, as this seems to be an old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing. If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.

tensorflowbutler avatar Mar 18 '20 21:03 tensorflowbutler