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

关于config文件里的n_cats设置 #314

Open
yangaiping opened this issue Aug 10, 2023 · 9 comments
Open

关于config文件里的n_cats设置 #314

yangaiping opened this issue Aug 10, 2023 · 9 comments

Comments

@yangaiping
Copy link

我通过check_dataset_info.py脚本查到我的所有数据集标签图像像素值区间是[0,132],但是我的数据集标签类别一共才13类,为什么n_cats设成13我的训练就会报错呢,但是设成133又能成功运行?
image

@CoinCheung
Copy link
Owner

Your category does not in range of [0, 13], but in [0, 131] instead. You should convert the label values into [0, 13].

@yangaiping
Copy link
Author

您是什么意思呢,我的图像像素值区间是[0,132],但是我的像素颜色种类是13,那我的n_cats应该设为多少呢

@CoinCheung
Copy link
Owner

You should map the pixel value of your label file into range of [0, 12].

@yangaiping
Copy link
Author

代码里的这个输出[0,132]难道不是像素的最小值与最大值形成的区间吗
image
image

@CoinCheung
Copy link
Owner

CoinCheung commented Aug 10, 2023

You have 13 categories, but your category index are not continously ranging from 0 to 12, they are sparsely ranging from 0 to 132.

You should map your raw label values continuously into range [0, 12].

For example, in the picture above, we can see the mapping rule as:

0    -> 0
14  -> 1
19  -> 2
....

You should process your label files to by-pass those empty categories, or you have to set the number of categories into 132.

@CoinCheung
Copy link
Owner

They are expected to be singe channel image.

@yangaiping
Copy link
Author

我明白您的意思了,我的png格式的标签文件有问题,我应该下去修改,是需要把彩色标签图像改成单通道8位标签图像吗

@CoinCheung
Copy link
Owner

Yes, they are expected to be single channel with label values rather than pixel values.

@yangaiping
Copy link
Author

非常感谢您,我再下去试试。再次感谢

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