progressive-growing-of-gans.pytorch icon indicating copy to clipboard operation
progressive-growing-of-gans.pytorch copied to clipboard

pytorch on windows does not support multiprocessing

Open powerspowers opened this issue 6 years ago • 6 comments

I'm attempting to figure out which bits of the code attempt to spawn new processes since this fails on Windows 10 pytorch. I had to modify pcgan in a similar manner to get it to work recently.

powerspowers avatar May 22 '19 03:05 powerspowers

Wrapping the main calls at the bottom of pggan.py in main seems to have solved the multiprocessing problem

if __name__ == '__main__':

powerspowers avatar May 22 '19 03:05 powerspowers

Also appears you have to remove Volatile=true since that's been deprecated

powerspowers avatar May 22 '19 03:05 powerspowers

In addition all data[0] references need to be switched to item() which is a result of the Volatile tag being deprecated

https://github.com/pytorch/pytorch/issues/6061

powerspowers avatar May 22 '19 03:05 powerspowers

The last thing I had to do to get this working on Windows 10 pytorch was change all the directory and file creation paths to use backslashes instead of forward slashes. I also have to remove the '-p' flag in mkdir calls. I commented out the tensorboard code section until I can spend some time installing it. So far it seems to be running well on my Dell XPS with an nVidia 1080 (6GB).

powerspowers avatar May 22 '19 06:05 powerspowers

Also had to add in the following modification because DataParallel puts the original object into the module variable

self.G.module.grow_network(floor(self.resl)) self.D.module.grow_network(floor(self.resl))

powerspowers avatar May 23 '19 03:05 powerspowers

In intermediate_block you have to cast the ndim as an int because in python3 dividing two integers results in a float. grrr only collided into this one when the resl got to 6 and the code to divide ndim by two clicked in.

ndim = int(ndim / 2)

powerspowers avatar May 27 '19 09:05 powerspowers