Open Shuixin-Li opened 1 year ago
@mtjhl maybe you can help with this question?
For easy, you can set test path in dataset yaml file to val:
, for example
train: ../coco/images/train2017 # 118287 images
# 把 val path 设置为 test 的path
val: ../coco/images/val2017 # 5000 images
test: ../coco/images/test2017
You do not need to create instance_test.json by your self, yolov6 will generate it automatically according to yolo format labels.
为方便起见,您可以将数据集 yaml 文件中的测试路径设置为 ,例如
val:
train: ../coco/images/train2017 # 118287 images # 把 val path 设置为 test 的path val: ../coco/images/val2017 # 5000 images test: ../coco/images/test2017
但是这样还是对val数据集进行验证,我的数据集也是划分了3部分,包含test数据集。有什么方法生成test数据集对应的json文件,就像生成Val的json文件一样。来达到对test数据集进行验证的目的。
为方便起见,您可以将数据集 yaml 文件中的测试路径设置为 ,例如
val:
train: ../coco/images/train2017 # 118287 images # 把 val path 设置为 test 的path val: ../coco/images/val2017 # 5000 images test: ../coco/images/test2017
但是这样还是对val数据集进行验证,我的数据集也是划分了3部分,包含test数据集。有什么方法生成test数据集对应的json文件,就像生成Val的json文件一样。来达到对test数据集进行验证的目的。
我明白了,数据集分为三个部分,第一次训练使用val数据集进行训练中的验证。训练结束后将数据集配置文件中的val:路径改为test的路径,然后再train.py一次即可以生成instances_test.json,训练中断即可;主要为了得到json文件 然后使用eval.py进行test数据集的验证。这样数据集三个部分都用到了。
Before Asking
[X] I have read the README carefully. 我已经仔细阅读了README上的操作指引。
[X] I want to train my custom dataset, and I have read the tutorials for training your custom data carefully and organize my dataset correctly; (FYI: We recommand you to apply the config files of xx_finetune.py.) 我想训练自定义数据集,我已经仔细阅读了训练自定义数据的教程,以及按照正确的目录结构存放数据集。(FYI: 我们推荐使用xx_finetune.py等配置文件训练自定义数据集。)
[X] I have pulled the latest code of main branch to run again and the problem still existed. 我已经拉取了主分支上最新的代码,重新运行之后,问题仍不能解决。
Search before asking
Question
I split my data into train, val, test as usual, I sucessfully evaluated on val data set after training, but I received error when I try to evaluate test dataset.
steps
instances_test.json
I think I may need to createinstances_test.json
somewhere instead of creating them.python tools/eval.py --data data/dataset.yaml --weights runs/train/exp/weights/best_ckpt.pt --task test --device 0
log
dataset.yaml
Additional
No response