Spaces:
Runtime error
Runtime error
Update neural_style.py
Browse files- neural_style.py +3 -3
neural_style.py
CHANGED
@@ -249,7 +249,7 @@ def transfer(params):
|
|
249 |
print(" Style " + str(i+1) + " loss: " + str(loss_module.loss.item()))
|
250 |
print(" Total loss: " + str(loss.item()))
|
251 |
|
252 |
-
final_image = ''
|
253 |
def maybe_save(t):
|
254 |
should_save = params.save_iter > 950 and t % params.save_iter == 0
|
255 |
should_save = should_save or t == params.num_iterations
|
@@ -297,7 +297,7 @@ def transfer(params):
|
|
297 |
maybe_print(num_calls[0], loss)
|
298 |
|
299 |
return loss
|
300 |
-
print('the final image is', final_image)
|
301 |
optimizer, loopVal = setup_optimizer(img)
|
302 |
while num_calls[0] <= loopVal:
|
303 |
optimizer.step(feval)
|
@@ -411,7 +411,7 @@ def print_torch(net, multidevice):
|
|
411 |
simplelist = ""
|
412 |
for i, layer in enumerate(net, 1):
|
413 |
simplelist = simplelist + "(" + str(i) + ") -> "
|
414 |
-
print("nn.Sequential ( \n [input -> " + simplelist + "output]")
|
415 |
|
416 |
def strip(x):
|
417 |
return str(x).replace(", ",',').replace("(",'').replace(")",'') + ", "
|
|
|
249 |
print(" Style " + str(i+1) + " loss: " + str(loss_module.loss.item()))
|
250 |
print(" Total loss: " + str(loss.item()))
|
251 |
|
252 |
+
#final_image = ''
|
253 |
def maybe_save(t):
|
254 |
should_save = params.save_iter > 950 and t % params.save_iter == 0
|
255 |
should_save = should_save or t == params.num_iterations
|
|
|
297 |
maybe_print(num_calls[0], loss)
|
298 |
|
299 |
return loss
|
300 |
+
##print('the final image is', final_image)
|
301 |
optimizer, loopVal = setup_optimizer(img)
|
302 |
while num_calls[0] <= loopVal:
|
303 |
optimizer.step(feval)
|
|
|
411 |
simplelist = ""
|
412 |
for i, layer in enumerate(net, 1):
|
413 |
simplelist = simplelist + "(" + str(i) + ") -> "
|
414 |
+
#print("nn.Sequential ( \n [input -> " + simplelist + "output]")
|
415 |
|
416 |
def strip(x):
|
417 |
return str(x).replace(", ",',').replace("(",'').replace(")",'') + ", "
|