detectron2
使用自定义数据集进行训练的时候,提示:
ValueError: tuple.index(x): x not in tuple
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
Traceback (most recent call last): File "projects/SparseRCNN/train_net.py", line 143, in <module> args=(args,), File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/engine/launch.py", line 62, in launch main_func(*args) File "projects/SparseRCNN/train_net.py", line 129, in main trainer = Trainer(cfg) File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/engine/defaults.py", line 284, in __init__ data_loader = self.build_train_loader(cfg) File "projects/SparseRCNN/train_net.py", line 53, in build_train_loader return build_detection_train_loader(cfg, mapper=mapper) File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/config/config.py", line 201, in wrapped explicit_args = _get_args_from_config(from_config, *args, **kwargs) File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/config/config.py", line 236, in _get_args_from_config ret = from_config_func(*args, **kwargs) File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/data/build.py", line 309, in _train_loader_from_config proposal_files=cfg.DATASETS.PROPOSAL_FILES_TRAIN if cfg.MODEL.LOAD_PROPOSALS else None, File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/data/build.py", line 222, in get_detection_dataset_dicts dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in dataset_names] File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/data/build.py", line 222, in <listcomp> dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in dataset_names] File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/data/catalog.py", line 58, in get return f() File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/data/datasets/pascal_voc.py", line 78, in <lambda> DatasetCatalog.register(name, lambda: load_voc_instances(dirname, split, class_names)) File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/data/datasets/pascal_voc.py", line 70, in load_voc_instances {"category_id": class_names.index(cls), "bbox": bbox, "bbox_mode": BoxMode.XYXY_ABS} ValueError: tuple.index(x): x not in tuple |
原因是数据类别不一致,修改:
/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/data/datasets/pascal_voc.py
将CLASS_NAMES
改为正确的类别即可。
本文最后更新于2021年4月3日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
试试看看行不行
非常好
能否给个联系方式,交流一下请教一下
我感觉我解决了这个Netframework的问题了,安装好要求重启,重启以后安装deepl,但是又出问题了,显示there was an error while installing the appl
请您详细教我一下,怎么下载安装您说的这个.NET
又来麻烦您了,我下载好了,安装的时候提示:Failed to install the .NET Framework, try installing the latest version manuall
win7旗舰版
感谢回复。不是直接点就能安装啊,下载下来的是个压缩文件,解压后有6个内容:.background、.HFS+Private Directory Data、[HFS+Private Data]、Deep