Perspective Transformer Multi-GPU Training broken
System information
- What is the top-level directory of the model you are using: Ptn directory
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 14.04
- TensorFlow installed from (source or binary): Source
- TensorFlow version (use command below): ('v1.3.0-rc1-27-g2784b1c', '1.3.0-rc2')
- Bazel version (if compiling from source): 0.5.2
- CUDA/cuDNN version: 8.0/5.1
- GPU model and memory: 4x Titan X
- Exact command to reproduce: bazel-bin/train_ptn '--checkpoint_dir=/home/meeso/models/ptn/my_models/no_finetune' '--inp_dir=/home/meeso/Datasets/shapenet_tf/' '--ps_tasks=1' '--worker_replicas=3'
Describe the problem
The ability to train the perspective transformer on more than one gpu seems broken. I have 4 GPUs in one machine, so I would like to speedup the training times. It is not clear if I am running it correctly, I also tried running an instance with just '--ps_tasks=1' on one terminal and then in another just the '--worker_replicas=3', but it also failed.
Source code / logs
InvalidArgumentError (see above for traceback): Cannot assign a device for operation 'init_ops/init_all_tables': Operation was explicitly assigned to /job:worker but available devices are [ /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/gpu:0, /job:localhost/replica:0/task:0/gpu:1, /job:localhost/replica:0/task:0/gpu:2, /job:localhost/replica:0/task:0/gpu:3 ]. Make sure the device specification refers to a valid device.
[[Node: init_ops/init_all_tables = NoOp[_device="/job:worker"]()]]
I attach the output with the complete error.
error.txt
@xcyan, @arkanath any suggestions?
We will have a look and get back to you, thanks.
This does not seem like an issue specific to PTN, @mees. Like the error says, you probably need to set the device spec appropriately, please follow the tensorflow documentation.
Well I am not so convinced @arkanath. Can you confirm that if you execute the command I stated above, it works for you without any change to the ptn code? I spent a day looking on how I could get the multi-GPU setup working, going through the documentation, asking my collegues in the lab, and we could't get it working. I understand that if you want to distribute the training across machines, you need to make some changes in the code, but if the GPUs are on the same machine, the ptn code should work as it is right now, and it doesn't seem the case. It's also possible that I didn't succeed setting the right flags to train on multi-gpu, in this case I would be grateful for a minimal example on how to train ptn on two gpus that are sitting in the same machine.
What's the error message when doing multi-GPU setup? Since PTN implementation is based on slim library, let me make sure you are following slim tutorial. https://github.com/tensorflow/models/blob/master/slim/deployment/model_deploy.py#L33
I am not sure I understand, the error message is on the original bug report. Do you want me to add that line you mention in train_ptn.py ?
For multigpu training, you need to follow this tutorial and modify the code if needed.
My guess is you have an internal implementation and a public one, and you haven't tested if the multi-gpu setting works for the opensourced version. Sure I can try some more, but can you tell me if I need to run a separate instance just with the parameter server or if I can run everything at the same time, like in the command I posted in the bug report?
Here is a working example (please jump to distributed training part): https://github.com/tensorflow/models/tree/master/inception
On Fri, Aug 18, 2017 at 4:45 AM, Oier Mees [email protected] wrote:
My guess is you have an internal implementation and a public one, and you haven't tested if the multi-gpu setting works for the opensourced version. Sure I can try some more, but can you tell me if I need to run a separate instance just with the parameter server or if I can run everything at the same time, like in the command I posted in the bug report?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/2211#issuecomment-323332387, or mute the thread https://github.com/notifications/unsubscribe-auth/AIWuKytzWTDSqsp2X1A939dX-nZLeOe-ks5sZXlCgaJpZM4O23m0 .
I meet this error when convert to saved_model
- tf 1.6
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.