models icon indicating copy to clipboard operation
models copied to clipboard

tensorflow.python.framework.errors_impl.UnavailableError: Stream removed ERROR

Open Jana-Wessels opened this issue 8 years ago • 16 comments

Please go to Stack Overflow for help and support:

System information

  • What is the top-level directory of the model you are using: /models/research
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): n/a
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04
  • TensorFlow installed from (source or binary): source
  • TensorFlow version (use command below): 1.5
  • GPU model and memory: CPU
  • Exact command to reproduce: /home/jana/google-cloud-sdk/bin/gcloud ml-engine jobs submit training whoamiobject_detectiondate +%s
    --runtime-version 1.5
    --job-dir=gs://pets_jana/train
    --packages /home/jana/models/research/dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz
    --module-name object_detection.train
    --region us-central1
    --config /home/jana/models/research/object_detection/samples/cloud/cloud.yml
    --
    --train_dir=gs://pets_jana/train
    --pipeline_config_path=gs://pets_jana/models/model/faster_rcnn_resnet101_pets_online.config

Describe the problem

When submitting training job it gets to step 434 and the throws the error below (tensorflow.python.framework.errors_impl.UnavailableError: Stream removed) then continues to step 697 and fails. I don't even know where to start with this error. At the moment I am sitting with over 20 failed training runs with error fixing trying to get the pet data classification tutorial to work and I don't know where next. If anyone has a clue please help.

Source code / logs

The replica worker 0 exited with a non-zero status of 1. Termination reason: Error. Traceback (most recent call last): [...] File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 473, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.UnavailableError: Stream removed During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/root/.local/lib/python3.5/site-packages/object_detection/train.py", line 167, in tf.app.run() File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv)) File "/root/.local/lib/python3.5/site-packages/object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir) File "/root/.local/lib/python3.5/site-packages/object_detection/trainer.py", line 362, in train saver=saver) File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 767, in train sess, train_op, global_step, train_step_kwargs) File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 487, in train_step run_metadata=run_metadata) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 895, in run run_metadata_ptr) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1128, in _run feed_dict_tensor, options, run_metadata) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1344, in _do_run options, run_metadata) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1363, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.UnavailableError: Stream removed The replica worker 1 exited with a non-zero status of 1. Termination reason: Error. Traceback (most recent call last): [...] File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 473, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.UnavailableError: Stream removed During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/root/.local/lib/python3.5/site-packages/object_detection/train.py", line 167, in tf.app.run() File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv)) File "/root/.local/lib/python3.5/site-packages/object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir) File "/root/.local/lib/python3.5/site-packages/object_detection/trainer.py", line 362, in train saver=saver) File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 767, in train sess, train_op, global_step, train_step_kwargs) File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 487, in train_step run_metadata=run_metadata) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 895, in run run_metadata_ptr) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1128, in _run feed_dict_tensor, options, run_metadata) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1344, in _do_run options, run_metadata) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1363, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.UnavailableError: Stream removed To find out more about why your job exited please check the logs: https://console.cloud.google.com/logs/viewer?project=827587257014&resource=ml_job%2Fjob_id%2Fjana_object_detection_1522091457&advancedFilter=resource.type%3D%22ml_job%22%0Aresource.labels.job_id%3D%22jana_object_detection_1522091457%22

Jana-Wessels avatar Mar 26 '18 19:03 Jana-Wessels

I'm also getting that error. I get to about 1500 steps until it falls apart, though.

The replica worker 0 exited with a non-zero status of 1. Termination reason: Error. Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 167, in <module> tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv)) File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir) File "/root/.local/lib/python2.7/site-packages/object_detection/trainer.py", line 370, in train saver=saver) File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 767, in train sess, train_op, global_step, train_step_kwargs) File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 487, in train_step run_metadata=run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 895, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1128, in _run feed_dict_tensor, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1344, in _do_run options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1363, in _do_call raise type(e)(node_def, op, message) UnavailableError: Stream removed The replica worker 2 exited with a non-zero status of 1. Termination reason: Error. Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 167, in <module> tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv)) File "/root/.local/lib/python2.7/site-packages/object_detection/train.py", line 163, in main worker_job_name, is_chief, FLAGS.train_dir) File "/root/.local/lib/python2.7/site-packages/object_detection/trainer.py", line 370, in train saver=saver) File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 767, in train sess, train_op, global_step, train_step_kwargs) File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 487, in train_step run_metadata=run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 895, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1128, in _run feed_dict_tensor, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1344, in _do_run options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1363, in _do_call raise type(e)(node_def, op, message) UnavailableError: Stream removed To find out more about why your job exited please check the logs: https://console.cloud.google.com/logs/viewer?project=188784501564&resource=ml_job%2Fjob_id%2Fobject_detection_204&advancedFilter=resource.type%3D%22ml_job%22%0Aresource.labels.job_id%3D%22object_detection_204%22
{
  "scaleTier": "CUSTOM",
  "masterType": "complex_model_m_gpu",
  "workerType": "complex_model_m_gpu",
  "parameterServerType": "standard",
  "workerCount": "4",
  "parameterServerCount": "2",
  "packageUris": [
    "gs://ccfoto-model-data/models/train/packages/8557e0a91d8572ede3ee6715275b38fcea3ece4143bb9fc401e95134049fc1bd/object_detection-0.1.tar.gz",
    "gs://ccfoto-model-data/models/train/packages/8557e0a91d8572ede3ee6715275b38fcea3ece4143bb9fc401e95134049fc1bd/slim-0.1.tar.gz"
  ],
  "pythonModule": "object_detection.train",
  "args": [
    "--train_dir=gs://ccfoto-model-data/models/train",
    "--pipeline_config_path=gs://ccfoto-model-data/ssd_inception_v2.config"
  ],
  "region": "europe-west1",
  "runtimeVersion": "1.5",
  "jobDir": "gs://ccfoto-model-data/models/train"
}

TopHatCroat avatar Mar 26 '18 22:03 TopHatCroat

I'm also have exactly same error.

  • train.yaml
trainingInput:
  runtimeVersion: "1.5"
  scaleTier: CUSTOM
  masterType: standard_gpu
  workerCount: 5
  workerType: standard_gpu
  parameterServerCount: 3
  parameterServerType: standard_gpu
  pythonVersion: "3.5"
  • error message
{
 insertId:  "g3dqf0g26sotn6"  
 logName:  "projects/bigdata-ocr/logs/ml.googleapis.com%2Fobject_detection_1522115199"  
 receiveTimestamp:  "2018-03-27T01:56:54.305613793Z"  
 resource: {…}  
 severity:  "ERROR"  
 textPayload:  "The replica worker 2 exited with a non-zero status of 1. Termination reason: Error. 
Traceback (most recent call last):
  [...]
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.UnavailableError: Stream removed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/root/.local/lib/python3.5/site-packages/object_detection/train.py", line 167, in <module>
    tf.app.run()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 124, in run
    _sys.exit(main(argv))
  File "/root/.local/lib/python3.5/site-packages/object_detection/train.py", line 163, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "/root/.local/lib/python3.5/site-packages/object_detection/trainer.py", line 370, in train
    saver=saver)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 767, in train
    sess, train_op, global_step, train_step_kwargs)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 487, in train_step
    run_metadata=run_metadata)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 895, in run
    run_metadata_ptr)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1128, in _run
    feed_dict_tensor, options, run_metadata)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1344, in _do_run
    options, run_metadata)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1363, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.UnavailableError: Stream removed

alifejon avatar Mar 27 '18 02:03 alifejon

https://github.com/tensorflow/tensorflow/issues/12080 is this issue related?

alifejon avatar Mar 27 '18 02:03 alifejon

I have managed to get around this problem by increasing parameter server specs. It still failed for me when using ssd_inception_v2, but only after 12000 or so steps. After that, restarting the job from the checkpoint managed to nurse it to the 20000 steps I was looking for.
Using ssd_mobilenet there were no issues, and it reachet 80000 steps in 4 hours of work.

This is the config.yml I used:

trainingInput:
  runtimeVersion: "1.5"
  scaleTier: CUSTOM
  masterType: complex_model_m_gpu
  workerCount: 3
  workerType: complex_model_m_gpu
  parameterServerCount: 3
  parameterServerType: complex_model_m

TopHatCroat avatar Mar 27 '18 07:03 TopHatCroat

Hi TopHatCroat, can you explain how to restart the training from the check point? Thanks

nehcgnem avatar Mar 27 '18 07:03 nehcgnem

My job is still running with new setting, it may be succeed with below setting. The parameterServerType value is important.

trainingInput:
  runtimeVersion: "1.5"
  scaleTier: CUSTOM
  masterType: complex_model_m_p100
  workerCount: 3
  workerType: complex_model_m_p100
  parameterServerCount: 3
  parameterServerType: complex_model_l
  pythonVersion: "3.5"

alifejon avatar Mar 27 '18 08:03 alifejon

It failed after 26738 iteration.

alifejon avatar Mar 27 '18 09:03 alifejon

@nehcgnem just submit same job

alifejon avatar Mar 27 '18 13:03 alifejon

@alifejon whenever I submitted the same the job the step count zeroes. @TopHatCroat complex_model_l is not available for me. Can you explain how you restart the job from check point? Thanks

nehcgnem avatar Mar 27 '18 13:03 nehcgnem

@nehcgnem It will reset to 0 if there are no checkpoints saved. Take a look at the directory specified by --train_dir and --job-dir (they should be the same if you are running the provided scripts, ie. you have this --module-name object_detection.train ). That directory should contain checkpoint from previous runs which are automatically created about every 2000 or so steps, so if your job is not getting even to that number there will be nothing to continue from. Once you see there are checkpoints available, simply rerun the same job (only thing different should be the job ID) as @alifejon suggested

Why is complex_model_l not available to you? Try by simply increasing the parameter server count to the same as worker count

TopHatCroat avatar Mar 27 '18 15:03 TopHatCroat

@TopHatCroat Thanks for your help. I'm now trying with complex_model. For the checkpoint, I'm able to reach 9000+ steps but when I try to restart the job with different name(different time stamp) the step starts from zero again, but I was able to see the .ckpt files in my train_dir. Is there anything else we have to configure for the check point restart?

nehcgnem avatar Mar 27 '18 16:03 nehcgnem

Hmmm, I'm not sure what's gone wrong with your attempts to continue. I don't use a timestamp, just increment the name job number, but that should not matter. Make sure you have both --train_dir and --job-dir set to the same path. Otherwise I suggest asking on SO, TensorFlow people are pretty active over there as well.

TopHatCroat avatar Mar 27 '18 20:03 TopHatCroat

Ok, I finally solved it/ I got results info

  • mask rcnn inception
  • virtual env python 3.6
  • tensorflow 1.5
  • mac osx 10.2

here is my YAML file

trainingInput:
  runtimeVersion: "1.5"
  scaleTier: CUSTOM
  masterType: complex_model_m_gpu
  workerCount: 3
  workerType: complex_model_m_gpu
  parameterServerCount: 3
  parameterServerType: complex_model_m

I tried for hours testing and configuring different items. a few items I had to do before hand (on top of all the tensorflow installation)

  • added matplotlib as a requirement in research/setup.py
  • installed pillow==5.0.0 (I only did this because I am using super old macosx), pillow 5.1.0 does not work for my osx

here is where I finally got it to run after trying to run different configurations. I have no clue why this worked for me but it did. here is what I did

  1. ran this configuration and set my runtime to 1.7 in both YAML and python call to gcloud
"scaleTier": "CUSTOM",
  "masterType": "complex_model_m_gpu",
  "workerType": "complex_model_m_gpu",
  "parameterServerType": "standard",
  "workerCount": "4",
  "parameterServerCount": "4",
  "region": "us-central1",
  "runtimeVersion": "1.7",
  1. this failed after 11 minutes, I was sad, but I gave it another go. immediately but only changed one thing, that was the runtime Version to 1.5
  2. Success, my model trained up to 50,000 steps and than stopped.

I exported my checkpoint and created the frozen.pb, everything worked perfectly.

notes

  • I did not run the evaluation job or tensorboard. as I was primarily just trying to get some results.

seahawks8 avatar Apr 26 '18 14:04 seahawks8

I recommend use "complex_modle_m_gpu" for workerType

In my case, using "standard"Type was the reason why problem is occurred.

sooonwoo avatar May 09 '18 12:05 sooonwoo

Hi There, We are checking to see if you still need help on this, as this seems to be considerably 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 Jan 29 '20 23:01 tensorflowbutler

close it

seahawks8 avatar Jan 29 '20 23:01 seahawks8