You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After # compute styles when calling "style" facing an issue:
InvalidArgumentError: Must provide as many biases as the last dimension of the input tensor: [3] vs. [1,400,400,4] [Op:BiasAdd] name: style_model_7/BiasAdd/.
I found a reason initially if I run this:
compute styles
image_style_embeddings = {}
for image_path in tqdm(image_paths):
image_tensor = load_image(image_path)
style = style_to_vec(image_to_style(image_tensor))
image_style_embeddings[ntpath.basename(image_path)] = style
Then for some reason, the shape remains [1,400,400,4] when the tensor is empty but after when tensor start to fill the shape changes to [1,400,400,3]
But if I run this:
compute styles
image_style_embeddings = {}
for image_path in tqdm(image_paths):
->image_tensor = load_image(image_path)
->if (image_tensor.shape[3]!= 4):
-> ->style = style_to_vec(image_to_style(image_tensor))
->->image_style_embeddings[ntpath.basename(image_path)] = style
Its working fine is it ok to do?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
#image-artistic-style-similarity
After # compute styles when calling "style" facing an issue:
InvalidArgumentError: Must provide as many biases as the last dimension of the input tensor: [3] vs. [1,400,400,4] [Op:BiasAdd] name: style_model_7/BiasAdd/.
I found a reason initially if I run this:
compute styles
image_style_embeddings = {}
for image_path in tqdm(image_paths):
image_tensor = load_image(image_path)
style = style_to_vec(image_to_style(image_tensor))
image_style_embeddings[ntpath.basename(image_path)] = style
Then for some reason, the shape remains [1,400,400,4] when the tensor is empty but after when tensor start to fill the shape changes to [1,400,400,3]
But if I run this:
compute styles
image_style_embeddings = {}
for image_path in tqdm(image_paths):
->image_tensor = load_image(image_path)
->if (image_tensor.shape[3]!= 4):
-> ->style = style_to_vec(image_to_style(image_tensor))
->->image_style_embeddings[ntpath.basename(image_path)] = style
Its working fine is it ok to do?
Thanks in advance!
The text was updated successfully, but these errors were encountered: