Spaces:
Runtime error
Runtime error
Commit ·
25cc5fe
1
Parent(s): 4bc80a3
Update model.py
Browse files
model.py
CHANGED
|
@@ -88,9 +88,9 @@ class Generator(nn.Module):
|
|
| 88 |
up6 = self.up6(torch.cat([up5, d3], 1))
|
| 89 |
up7 = self.up7(torch.cat([up6, d2], 1))
|
| 90 |
return self.final_up(torch.cat([up7, d1], 1))
|
| 91 |
-
def load_model(name):
|
| 92 |
|
| 93 |
-
|
| 94 |
|
| 95 |
def gen_model():
|
| 96 |
transform = transforms.Compose([
|
|
@@ -100,7 +100,6 @@ def gen_model():
|
|
| 100 |
device="cpu"
|
| 101 |
# state = torch.load('gen.pth.tar', map_location='cpu')
|
| 102 |
# state = state['state_dict']
|
| 103 |
-
|
| 104 |
G.load_state_dict(torch.load(f"G101.pth", map_location='cpu'))
|
| 105 |
-
G
|
| 106 |
-
return gen,transform
|
|
|
|
| 88 |
up6 = self.up6(torch.cat([up5, d3], 1))
|
| 89 |
up7 = self.up7(torch.cat([up6, d2], 1))
|
| 90 |
return self.final_up(torch.cat([up7, d1], 1))
|
| 91 |
+
# def load_model(name):
|
| 92 |
|
| 93 |
+
# return G.to(device)
|
| 94 |
|
| 95 |
def gen_model():
|
| 96 |
transform = transforms.Compose([
|
|
|
|
| 100 |
device="cpu"
|
| 101 |
# state = torch.load('gen.pth.tar', map_location='cpu')
|
| 102 |
# state = state['state_dict']
|
| 103 |
+
G=Generator()
|
| 104 |
G.load_state_dict(torch.load(f"G101.pth", map_location='cpu'))
|
| 105 |
+
return G,transform
|
|
|