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

train出现尺寸不对 #1

Open
zzc-ai opened this issue Sep 3, 2021 · 14 comments
Open

train出现尺寸不对 #1

zzc-ai opened this issue Sep 3, 2021 · 14 comments

Comments

@zzc-ai
Copy link

zzc-ai commented Sep 3, 2021

ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 256, 1, 1])

@bubbliiiing
Copy link
Owner

你是不是在B站问过啦

@zzc-ai
Copy link
Author

zzc-ai commented Sep 9, 2021

对,已经解决啦,多谢大佬

@BugOOM
Copy link

BugOOM commented Sep 19, 2021

同问

@guanbin1994
Copy link

对,已经解决啦,多谢大佬

怎么解救呀

@bubbliiiing
Copy link
Owner

batch设置偶数看看把

@ZoeM2016
Copy link

大佬,我把batchsize已经设置为2,但是在多卡训练的时候还是出现了这个错误,该怎么办呢 raise ValueError('Expected more than 1 value per channel when training, got input size {}'.format(size))
ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 256, 1, 1])
Init_Epoch = 100
Freeze_Epoch = 50
Freeze_batch_size = 2
UnFreeze_Epoch = 150
Unfreeze_batch_size = 2

@bubbliiiing
Copy link
Owner

你几个卡?

@praymich
Copy link

@bubbliiiing 大佬,我也遇到这个问题了,batch设成偶数还是会报错,有四张卡

@bubbliiiing
Copy link
Owner

分配到每个卡上的是偶数就可以应该

@shijiechua
Copy link

@bubbliiiing 大佬,代码里面batch已经是偶数了,但在服务器上只能跑50轮,第51轮就报这个错误

@bubbliiiing
Copy link
Owner

截图看看呢

@bubbliiiing
Copy link
Owner

你的训练参数

@shijiechua
Copy link

image

@bubbliiiing
Copy link
Owner

……你服务器单卡?

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

7 participants