PyTorch-Encoding icon indicating copy to clipboard operation
PyTorch-Encoding copied to clipboard

Question about DataParallelModel - too many values to unpack

Open SiminLi opened this issue 3 years ago • 3 comments

Dear HangZhang, Thanks for your code! I was working on a multi-GPU version of my code, which is like:

model = CDCK2(xxx) model = encoding.parallel.DataParallelModel(model).cuda()

The model is something like h, z=model(x).

While running the model using encoding.parallel.DataParallelModel, it gives me an error of "too many values to unpack". I believe the error must be that the model returns multiple output from different GPUs. I'm not very familiar of data parallelism. Could you please share some hints on how to fix this?

SiminLi avatar Mar 05 '21 12:03 SiminLi

Sorry, and there's another problem. I successfully build encoding in a conda environment and successfully import encoding at the terminal. However, after I use linux's screen or tmux, and activate the conda environment again, python reports "cannot import name 'cpu' from encoding". How can that happen?

SiminLi avatar Mar 05 '21 12:03 SiminLi

I met the same problem

Zerg-Overmind avatar Jan 05 '22 17:01 Zerg-Overmind

Please use it together with DataParallelCriterion https://hangzhang.org/PyTorch-Encoding/parallel.html#dataparallelcriterion

zhanghang1989 avatar Jan 10 '22 04:01 zhanghang1989