Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Network.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def deprocess_image(x):
x = np.clip(x, 0, 255).astype('uint8')
return x

def load_weights(weight_path, model):
def load_weights(weights_path, model):
assert os.path.exists(weights_path), 'Model weights not found (see "weights_path" variable in script).'
f = h5py.File(weights_path)
for k in range(f.attrs['nb_layers']):
Expand Down Expand Up @@ -160,7 +160,7 @@ def combine_loss_and_gradient(loss, gradient):
return f_outputs

def prepare_image():
assert args.init_image in ["content", "noise"] , "init_image must be one of ['original', 'noise']"
assert args.init_image in ["content", "noise"] , "init_image must be one of ['content', 'noise']"
if "content" in args.init_image:
x = preprocess_image(base_image_path, True)
else:
Expand Down Expand Up @@ -334,4 +334,4 @@ def grads(self, x):
imsave(fname, img)
end_time = time.time()
print('Image saved as', fname)
print('Iteration %d completed in %ds' % (i+1, end_time - start_time))
print('Iteration %d completed in %ds' % (i+1, end_time - start_time))