Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

test error #14

Open
donghyunyoo opened this issue Apr 3, 2018 · 9 comments
Open

test error #14

donghyunyoo opened this issue Apr 3, 2018 · 9 comments

Comments

@donghyunyoo
Copy link

I got this error.

Traceback (most recent call last):
File "main.py", line 290, in
main()
File "main.py", line 45, in main
evaluate(args)
File "main.py", line 258, in evaluate
output = utils.color_match(output, style_v)
File "/media/hdd1/donghyun/armor/PyTorch-Multi-Style-Transfer/experiments/utils.py", line 150, in color_match
src_flat_nrom_trans = matSqrt(dst_flat_cov_eye) * matSqrt(src_flat_cov_eye).inverse * src_norm
RuntimeError: mul() received an invalid combination of arguments - got (builtin_function_or_method), but expected one of:

  • (float other)
    didn't match because some of the arguments have invalid types: (builtin_function_or_method)
  • (Variable other)
    didn't match because some of the arguments have invalid types: (builtin_function_or_method)

How can I fix this?

@suke27
Copy link

suke27 commented Apr 11, 2018

do you resolve it, I face similar problem
src_flat_cov_eye = src_norm @ src_norm.t() + Variable(torch.eye(3).cuda())

@donghyunyoo
Copy link
Author

Yes. In my case, I resolved it with this modification.
src_flat_nrom_trans = matSqrt(dst_flat_cov_eye) * matSqrt(src_flat_cov_eye).inverse() * src_norm

@suke27
Copy link

suke27 commented Apr 12, 2018

which file do you modify?
@donghyunyoo

@suke27
Copy link

suke27 commented Apr 12, 2018

the paper said support "Brush Stroke Size Control." do you know how to evaluate in different brush stroke size
@donghyunyoo

@lxy443626128
Copy link

@suke27
did you solve it?

src_flat_cov_eye = src_norm @ src_norm.t() + Variable(torch.eye(3).cuda())

@suke27
Copy link

suke27 commented Apr 16, 2018

not yet

@gwenguo090006
Copy link

@donghyunyoo I make the same modification as you, but then a new error occurs as follow:
RuntimeError: The size of tensor a (3) must match the size of tensor b (655360) at non-singleton dimension 1
Did you ever encounter this error? I don't know if I could change the data formation of this script.

@LoicEm
Copy link

LoicEm commented Apr 19, 2018

@gwenguo090006
I just ran into the same error, which seems to originate from the latest commit (didn't have any error before that).

The error comes from utils.color_match that is now used right before saving the output in main.py.
A quick fix is for now to comment out line 258 in main.py :
output = utils.color_match(output, style_v)

It seems to work for me

@gwenguo090006
Copy link

@LoicEm
yes, your solution is feasible. And then I step into the color_match function, I think it is used to render the output image further. The error occurs when the multiplication between two matrices . I don't know why this happened, I don' think it's a confusion of the author between element product and matrix product. But when I modify the element product to matrix product, it works. However, the result is a little different from the case when you just comment out line 258 but it's also a style-transfer result of the original image.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants