ptrblck:

.permute(1, 2, 0)


Hi,
sorry, the data3 is the torch size of (64,21,21,11), I want to see the middle slice in grid. I am using the current code it give me error. Would you please tell me what is wrong? the fake33 has a (64,21,21) size.
Error is :  (TypeError(“Invalid dimensions for image data”)
TypeError: Invalid dimensions for image data)
            fake33=data3[:,:,:,6]
            plt.close("all")
            plt.figure()
            plt.figure(figsize=(8,8))
            plt.axis("off")
            plt.title("Fake Images")
            plt.imshow(np.transpose(vutils.make_grid(fake33.detach().to(device)[:64], padding=2, normalize=True).cpu(),(1,2,0)))
            plt.savefig(os.path.join(root_dirDurringTraining13+'Eoch-'+str(epoch)+'Seed='+str(manualSeed))+'fakes.jpg')