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

received rank:2 != label_dims.size():3 #129

Closed
weiheshiqingchun opened this issue May 23, 2020 · 8 comments
Closed

received rank:2 != label_dims.size():3 #129

weiheshiqingchun opened this issue May 23, 2020 · 8 comments

Comments

@weiheshiqingchun
Copy link

报错: File "tools/train.py", line 124, in
main(args)


Error Message Summary:

InvalidArgumentError: If Attr(soft_label) == true, Input(X) and Input(Label) shall have the same dimensions. But received: the dimensions of Input(X) is [2],the shape of Input(X) is [-1, 2], the dimensions of Input(Label) is [3], the shape ofInput(Label) is [-1, 1, 2]
[Hint: Expected rank == label_dims.size(), but received rank:2 != label_dims.size():3.] at (D:\1.8.1\paddle\paddle\fluid\operators\cross_entropy_op.cc:63)
[operator < cross_entropy > error]
INFO 2020-05-23 18:17:34,812 utils.py:272] terminate all the procs
ERROR 2020-05-23 18:17:34,812 utils.py:416] ABORT!!! Out of all 1 trainers, the trainer process with rank=[0] was aborted. Please check its log.
INFO 2020-05-23 18:17:34,813 utils.py:272] terminate all the procs

图片512*512png,8位深度,类别1,2,3。这个报错里的rank和label_dims.size()分别是什么意思??

@weiheshiqingchun
Copy link
Author

还有下载个示例图片下了几个小时没下完。拜托下次换个能放国内服务器得图片集。

@littletomatodonkey
Copy link
Collaborator

报错: File "tools/train.py", line 124, in
main(args)

Error Message Summary:

InvalidArgumentError: If Attr(soft_label) == true, Input(X) and Input(Label) shall have the same dimensions. But received: the dimensions of Input(X) is [2],the shape of Input(X) is [-1, 2], the dimensions of Input(Label) is [3], the shape ofInput(Label) is [-1, 1, 2]
[Hint: Expected rank == label_dims.size(), but received rank:2 != label_dims.size():3.] at (D:\1.8.1\paddle\paddle\fluid\operators\cross_entropy_op.cc:63)
[operator < cross_entropy > error]
INFO 2020-05-23 18:17:34,812 utils.py:272] terminate all the procs
ERROR 2020-05-23 18:17:34,812 utils.py:416] ABORT!!! Out of all 1 trainers, the trainer process with rank=[0] was aborted. Please check its log.
INFO 2020-05-23 18:17:34,813 utils.py:272] terminate all the procs

图片512*512png,8位深度,类别1,2,3。这个报错里的rank和label_dims.size()分别是什么意思??

您好,配置文件中的classes_num修改了吗?这个需要修改为您的类别数。

@weiheshiqingchun
Copy link
Author

weiheshiqingchun commented May 25, 2020 via email

@littletomatodonkey
Copy link
Collaborator

您好,class_num也是需要算是背景类的,您如果前景有2类,背景1类,那总共应该是3类

@weiheshiqingchun
Copy link
Author

weiheshiqingchun commented May 25, 2020 via email

@littletomatodonkey
Copy link
Collaborator

麻烦提供下训练的标签文件(train_list.txt & test_list.txt)和配置文件(*.yaml)吧,您zip里面提供的文件名使用该命令无法转换
image

image

@weiheshiqingchun
Copy link
Author

weiheshiqingchun commented May 25, 2020 via email

@littletomatodonkey
Copy link
Collaborator

感谢您的反馈,已经修复该问题,您拉取下最新代码即可,改动的地方可以参考这个PR。#130

@WuHaobo WuHaobo closed this as completed Jun 7, 2020
HydrogenSulfate pushed a commit to HydrogenSulfate/PaddleClas that referenced this issue Oct 18, 2023
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

3 participants