Closed ghost closed 1 year ago
If you read the notebook you'll see at some point:
Comment or un-comment out a few lines of code to seamlessly switch between standard AE and denoising one.
# Train standard or denoising autoencoder (AE) num_epochs = 20 # do = nn.Dropout() # comment out for standard AE for epoch in range(num_epochs): for data in dataloader: img, _ = data img = img.to(device) img = img.view(img.size(0), -1) # noise = do(torch.ones(img.shape)).to(device) # img_bad = (img * noise).to(device) # comment out for standard AE # ===================forward===================== output = model(img) # feed <img> (for std AE) or <img_bad> (for denoising AE) loss = criterion(output, img.data)
Hi!
When I'm trying to run the code 10-autoencoder.ipynb I get an error in the second to last cell, which is:
The error saying:
How could I fix this? Thanks!