sagemaker-python-sdk icon indicating copy to clipboard operation
sagemaker-python-sdk copied to clipboard

Cannot colocate nodes, Cannot merge devices with incompatible jobs: '/job:master/task:0' and '/job:ps/task:1'

Open gautiese opened this issue 8 years ago • 4 comments

Please fill out the form below.

System Information

  • Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Tensorflow (Keras)
  • Framework Version: 1.8
  • Python Version: 3.6
  • CPU or GPU: CPU
  • Python SDK Version:
  • Are you using a custom image: No

Describe the problem

I created a keras_model_fn and am trying to train the model on 3 c4 instances. Unfortunately, I get the following error (detailed below). Stackoverflow suggest using soft_placement (dont know what that means, or how to use it) Help!

Minimal repro / logs

InvalidArgumentError (see above for traceback): Cannot colocate nodes 'embedding_1/embeddings' and 'training/Adam/gradients/embedding_1/GatherV2_grad/Shape: Cannot merge devices with incompatible jobs: '/job:master/task:0' and '/job:ps/task:1' #011 [[Node: embedding_1/embeddings = VariableV2_class=["loc:@embedding_1/embeddings"], container="", dtype=DT_FLOAT, shape=[28,300], shared_name="", _device="/job:ps/task:1"]]

gautiese avatar Jul 31 '18 10:07 gautiese

sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True, log_device_placement=False))

tsoi2 avatar Aug 14 '18 14:08 tsoi2

Hello,

This will be difficult to diagnose without getting a minimal repro.

Thanks!

ChoiByungWook avatar Aug 15 '18 01:08 ChoiByungWook

Distributed tensorflow training is not currently supported if you use the keras_model_fn. You need to convert your model to use a tensorflow estimator through model_fn.

See the following: https://github.com/aws/sagemaker-python-sdk/tree/master/src/sagemaker/tensorflow#using-a-keras-model-instead-of-a-model_fn

khu834 avatar Aug 17 '18 22:08 khu834

@khu834 Thanks for clarification!

I apologize that I wasn't able to recognize that this was the problem for @gautiese.

I'll close this issue, as it doesn't seem we can resolve the problem.

ChoiByungWook avatar Aug 20 '18 21:08 ChoiByungWook