Skip to content
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

运行test.py时报错 #6

Closed
zhangting1994 opened this issue Apr 22, 2020 · 1 comment
Closed

运行test.py时报错 #6

zhangting1994 opened this issue Apr 22, 2020 · 1 comment

Comments

@zhangting1994
Copy link

Traceback (most recent call last):
File "test.py", line 56, in
cartoon = c2p.inference(img)
File "test.py", line 43, in inference
cartoon = self.net(face)[0][0]
File "C:\ProgramData\Anaconda3\envs\gpu\lib\site-packages\torch\nn\modules\module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "C:\Users\24238\Desktop\zhangting\photo2cartoon\models\networks.py", line 120, in forward
x = self.DecodeBlock1(x, content_features4, style_features)
File "C:\ProgramData\Anaconda3\envs\gpu\lib\site-packages\torch\nn\modules\module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "C:\Users\24238\Desktop\zhangting\photo2cartoon\models\networks.py", line 296, in forward
out = self.norm1(out, content_features, style_features)
File "C:\ProgramData\Anaconda3\envs\gpu\lib\site-packages\torch\nn\modules\module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "C:\Users\24238\Desktop\zhangting\photo2cartoon\models\networks.py", line 354, in forward
out = self.norm(x, soft_gamma, soft_beta)
File "C:\ProgramData\Anaconda3\envs\gpu\lib\site-packages\torch\nn\modules\module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "C:\Users\24238\Desktop\zhangting\photo2cartoon\models\networks.py", line 366, in forward
in_mean, in_var = torch.mean(input, dim=[2, 3], keepdim=True), torch.var(input, dim=[2, 3], keepdim=True)
TypeError: var(): argument 'dim' must be int, not list

@hao-qiang
Copy link
Member

pytorch1.1之前的版本dim只接受int型,请尝试将pytorch版本更新到1.4。

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

No branches or pull requests

2 participants