Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
•
87368d2
1
Parent(s):
5141731
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ use_gpu = True if torch.cuda.is_available() else False
|
|
7 |
model = torch.hub.load('facebookresearch/pytorch_GAN_zoo:hub', 'DCGAN', pretrained=True, useGPU=use_gpu)
|
8 |
|
9 |
def dcgan(num_images):
|
10 |
-
noise, _ = model.buildNoiseData(num_images)
|
11 |
with torch.no_grad():
|
12 |
generated_images = model.test(noise)
|
13 |
plt.imshow(torchvision.utils.make_grid(generated_images).permute(1, 2, 0).cpu().numpy())
|
|
|
7 |
model = torch.hub.load('facebookresearch/pytorch_GAN_zoo:hub', 'DCGAN', pretrained=True, useGPU=use_gpu)
|
8 |
|
9 |
def dcgan(num_images):
|
10 |
+
noise, _ = model.buildNoiseData(int(num_images))
|
11 |
with torch.no_grad():
|
12 |
generated_images = model.test(noise)
|
13 |
plt.imshow(torchvision.utils.make_grid(generated_images).permute(1, 2, 0).cpu().numpy())
|