Adversarial-Autoencoder
Adversarial-Autoencoder copied to clipboard
Error in utils.inf_train_gen()
I tried to run the code for mnist. Something goes wrong with loading the images in the function:
def inf_train_gen(train_gen): while True: for i, (images, _) in enumerate(train_gen): # yield images.astype('float32').reshape(BATCH_SIZE, 3, 32, 32).transpose(0, 2, 3, 1) yield images
File "Adversarial-Autoencoder/utils.py", line 68, in inf_train_gen for i, (images, _) in enumerate(train_gen): TypeError: 'function' object is not iterable
Hi, thanks for pointing this out. I'm not sure how that error crept in there.
data/mnist.py
was returning a function get_epoch
-- which returns a generator.
The inf_gen was missing the function call train_gen()
in the enumeration, among one or two other issues. I pushed a working version.
Really, the whole thing needs to be refactored to PyTorch 1.0+. If you're using anything after 0.31 (I believe), this code has a lot of deprecated functionality. The inf_gen idea is especially archaic and needs to be updated to use PyTorch dataloaders. Ill look at doing it this weekend.