New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
attack.py cannot reshape array of size 12544 into shape (1,3,112,112) #16
Comments
Have you solved it, please? I also had this issue, but I added the parameter'channel_axis=2' and 12544 became 50176. |
l don't solve it and do you have any ideas |
which line do you add the channel_axis=2? |
rescale(channel_axis=2)
nihao13548cun
***@***.***
…------------------ 原始邮件 ------------------
发件人: "papermsucode/advhat" ***@***.***>;
发送时间: 2022年10月28日(星期五) 晚上8:02
***@***.***>;
***@***.******@***.***>;
主题: Re: [papermsucode/advhat] attack.py cannot reshape array of size 12544 into shape (1,3,112,112) (Issue #16)
which line do you add the channel_axis=2?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
and my tensorflow version is 1.14.0 with numpy 1.19.2 |
you can try it
nihao13548cun
***@***.***
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2022年10月28日(星期五) 晚上8:05
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [papermsucode/advhat] attack.py cannot reshape array of size 12544 into shape (1,3,112,112) (Issue #16)
l found my problem is the shape of image is(112,112,1)
However l use the image input is(600,600,3)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
it seems not work as well |
change it ,this is my problem?maybe the problem is rescale
nihao13548cun
***@***.***
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2022年10月28日(星期五) 晚上8:14
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [papermsucode/advhat] attack.py cannot reshape array of size 12544 into shape (1,3,112,112) (Issue #16)
it seems not work as well
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
so have you already manage to solve them? |
no |
This problem is because your version of scikit-image is too high, when using the rescale function, it reads not an RGB image but a grayscale map, the solution is simple, either reduce the scikit-image version or replace the rescale function: |
l try to use attack.py to prepare face attack. l followed you steps and when trying to use anchor_face .it shows me that File "attack.py", line 24, in prep
return np.transpose(im, [2, 0, 1]).reshape((1, 3, 112, 112)) * 2 - 1#.reshape( [1,3,120, 120])*2-1
ValueError: cannot reshape array of size 12544 into shape (1,3,112,112). Is there something l need to set
The text was updated successfully, but these errors were encountered: