bshall / VectorQuantizedVAE

A PyTorch implementation of "Continuous Relaxation Training of Discrete Latent Variable Image Models"
MIT License
71 stars 16 forks source link

Updates to lambda transofrmation to make it Windows compatible #2

Closed jonathan-owens closed 4 years ago

jonathan-owens commented 4 years ago

Move from using a lambda in transforms.Compose to using transforms.Lambda, so that the transforms list can be pickled on Windows and used with multiple DataLoader workers.

This alleviates errors of this nature:

C:/w/1/s/tmp_conda_3.7_055457/conda/conda-bld/pytorch_1565416617654/work/aten/src/THC/THCTensorScatterGather.cu:100: block: [8,0,0], thread: [447,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed.

See problem discussion here and see here for discussion of the implemented solution.

bshall commented 4 years ago

Hi @jonathan-owens,

Thanks for the PR. Everything works as expected on my side so happy to merge :thumbsup: