Python 当我使用YOLACT运行train.py时,我得到错误键error:0

Python 当我使用YOLACT运行train.py时,我得到错误键error:0,python,pytorch,Python,Pytorch,我不熟悉机器学习和编程。 现在我正试图用我自己的数据来开发人工智能。 但是,当我运行train.py时,会出现以下错误,无法学习。 我能做些什么来克服这个错误` (yolact) tmori@tmori-Lenovo-Legion-Y740-15IRHg:~/yolact$ python train.py --config=can_config --save_interval=2000 正在将批注加载到内存。。。 完成(t=0.00s) 正在创建索引。。。 创建索引! 正在将批注加载到内存。

我不熟悉机器学习和编程。 现在我正试图用我自己的数据来开发人工智能。 但是,当我运行train.py时,会出现以下错误,无法学习。 我能做些什么来克服这个错误`

(yolact) tmori@tmori-Lenovo-Legion-Y740-15IRHg:~/yolact$ python train.py --config=can_config  --save_interval=2000
正在将批注加载到内存。。。 完成(t=0.00s) 正在创建索引。。。 创建索引! 正在将批注加载到内存。。。 完成(t=0.00s) 正在创建索引。。。 创建索引! 正在初始化权重。。。 开始训练! /home/tmori/yolact/utils/augmentations.py:309:VisibleDeprecationWarning:不推荐使用不规则嵌套序列(即列表或元组,或具有不同长度或形状的元组或ndarray)创建ndarray。如果要执行此操作,必须指定&apos;数据类型=对象&apos;创建ndarray时 模式=随机选择(自采样选项) /home/tmori/yolact/utils/augmentations.py:309:VisibleDeprecationWarning:不推荐使用不规则嵌套序列(即列表或元组,或具有不同长度或形状的元组或ndarray)创建ndarray。如果要执行此操作,必须指定&apos;数据类型=对象&apos;创建ndarray时 模式=随机选择(自采样选项) /home/tmori/yolact/utils/augmentations.py:309:VisibleDeprecationWarning:不推荐使用不规则嵌套序列(即列表或元组,或具有不同长度或形状的元组或ndarray)创建ndarray。如果要执行此操作,必须指定&apos;数据类型=对象&apos;创建ndarray时 模式=随机选择(自采样选项) /home/tmori/yolact/utils/augmentations.py:309:VisibleDeprecationWarning:不推荐使用不规则嵌套序列(即列表或元组,或具有不同长度或形状的元组或ndarray)创建ndarray。如果要执行此操作,必须指定&apos;数据类型=对象&apos;创建ndarray时 模式=随机选择(自采样选项) [0]0 | B:4.840 | C:16.249 | M:4.682 | S:2.749 | T:28.521 | ETA:9:18:44 |计时器:3.352 /home/tmori/yolact/utils/augmentations.py:309:VisibleDeprecationWarning:不推荐使用不规则嵌套序列(即列表或元组,或具有不同长度或形状的元组或ndarray)创建ndarray。如果要执行此操作,必须指定&apos;数据类型=对象&apos;创建ndarray时 模式=随机选择(自采样选项) /home/tmori/yolact/utils/augmentations.py:309:VisibleDeprecationWarning:不推荐使用不规则嵌套序列(即列表或元组,或具有不同长度或形状的元组或ndarray)创建ndarray。如果要执行此操作,必须指定&apos;数据类型=对象&apos;创建ndarray时 模式=随机选择(自采样选项) /home/tmori/yolact/utils/augmentations.py:309:VisibleDeprecationWarning:不推荐使用不规则嵌套序列(即列表或元组,或具有不同长度或形状的元组或ndarray)创建ndarray。如果要执行此操作,必须指定&apos;数据类型=对象&apos;创建ndarray时 模式=随机选择(自采样选项) /home/tmori/yolact/utils/augmentations.py:309:VisibleDeprecationWarning:不推荐使用不规则嵌套序列(即列表或元组,或具有不同长度或形状的元组或ndarray)创建ndarray。如果要执行此操作,必须指定&apos;数据类型=对象&apos;创建ndarray时 模式=随机选择(自采样选项) [1]10 | B:4.535 | C:9.228 | M:4.379 | S:1.867 | T:20.008 | ETA:3:25:24 |计时器:0.864 /home/tmori/yolact/utils/augmentations.py:309:VisibleDeprecationWarning:不推荐使用不规则嵌套序列(即列表或元组,或具有不同长度或形状的元组或ndarray)创建ndarray。如果要执行此操作,必须指定&apos;数据类型=对象&apos;创建ndarray时 模式=随机选择(自采样选项) /home/tmori/yolact/utils/augmentations.py:309:VisibleDeprecationWarning:不推荐使用不规则嵌套序列(即列表或元组,或具有不同长度或形状的元组或ndarray)创建ndarray。如果要执行此操作,必须指定&apos;数据类型=对象&apos;创建ndarray时 模式=随机选择(自采样选项) /home/tmori/yolact/utils/augmentations.py:309:VisibleDeprecationWarning:不推荐使用不规则嵌套序列(即列表或元组,或具有不同长度或形状的元组或ndarray)创建ndarray。如果要执行此操作,必须指定&apos;数据类型=对象&apos;创建ndarray时 模式=随机选择(自采样选项) /home/tmori/yolact/utils/augmentations.py:309:VisibleDeprecationWarning:不推荐使用不规则嵌套序列(即列表或元组,或具有不同长度或形状的元组或ndarray)创建ndarray。如果要执行此操作,必须指定&apos;数据类型=对象&apos;创建ndarray时 模式=随机选择(自采样选项) 正在计算验证映射(这可能需要一些时间)。。。 回溯(最近一次呼叫最后一次): 文件“train.py”,第504行,在 列车() 列车中第371行的文件“train.py” 计算验证映射(历元、迭代、YLACT网络、val数据集、log if args.log else None) 文件“train.py”,第492行,在compute\u validation\u映射中 val_info=eval_script.evaluate(yolact_net,数据集,训练模式=True) 文件“/home/tmori/yolact/eval.py”,第956行,在evaluate中 准备度量(ap_数据、preds、img、gt、gt_掩码、h、w、num_群组、dataset.ids[image_idx],检测) 文件“/home/tmori/yolact/eval.py”,第427行,在prep_度量中 检测。添加框(图像标识,类[i],框[i,:],框[i]分数[i]) 文件“/ loading annotations into memory... Done (t=0.00s) creating index... index created! loading annotations into memory... Done (t=0.00s) creating index... index created! Initializing weights... Begin training! /home/tmori/yolact/utils/augmentations.py:309: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray mode = random.choice(self.sample_options) /home/tmori/yolact/utils/augmentations.py:309: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray mode = random.choice(self.sample_options) /home/tmori/yolact/utils/augmentations.py:309: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray mode = random.choice(self.sample_options) /home/tmori/yolact/utils/augmentations.py:309: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray mode = random.choice(self.sample_options) [ 0] 0 || B: 4.840 | C: 16.249 | M: 4.682 | S: 2.749 | T: 28.521 || ETA: 9:18:44 || timer: 3.352 /home/tmori/yolact/utils/augmentations.py:309: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray mode = random.choice(self.sample_options) /home/tmori/yolact/utils/augmentations.py:309: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray mode = random.choice(self.sample_options) /home/tmori/yolact/utils/augmentations.py:309: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray mode = random.choice(self.sample_options) /home/tmori/yolact/utils/augmentations.py:309: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray mode = random.choice(self.sample_options) [ 1] 10 || B: 4.535 | C: 9.228 | M: 4.379 | S: 1.867 | T: 20.008 || ETA: 3:25:24 || timer: 0.864 /home/tmori/yolact/utils/augmentations.py:309: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray mode = random.choice(self.sample_options) /home/tmori/yolact/utils/augmentations.py:309: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray mode = random.choice(self.sample_options) /home/tmori/yolact/utils/augmentations.py:309: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray mode = random.choice(self.sample_options) /home/tmori/yolact/utils/augmentations.py:309: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray mode = random.choice(self.sample_options) Computing validation mAP (this may take a while)... Traceback (most recent call last): File "train.py", line 504, in <module> train() File "train.py", line 371, in train compute_validation_map(epoch, iteration, yolact_net, val_dataset, log if args.log else None) File "train.py", line 492, in compute_validation_map val_info = eval_script.evaluate(yolact_net, dataset, train_mode=True) File "/home/tmori/yolact/eval.py", line 956, in evaluate prep_metrics(ap_data, preds, img, gt, gt_masks, h, w, num_crowd, dataset.ids[image_idx], detections) File "/home/tmori/yolact/eval.py", line 427, in prep_metrics detections.add_bbox(image_id, classes[i], boxes[i,:], box_scores[i]) File "/home/tmori/yolact/eval.py", line 315, in add_bbox 'category_id': get_coco_cat(int(category_id)), File "/home/tmori/yolact/eval.py", line 293, in get_coco_cat return coco_cats[transformed_cat_id] KeyError: 0
'label_map': { 0:  1, 1:  2, 2:  3... and so on}
cans_dataset = dataset_base.copy({
'name': 'cans_dataset',

'train_images': './cans/cans_train/',
'train_info':   './cans/cans_train/train.json',

'valid_images': './cans/cans_test/',
'valid_info':   './cans/cans_test/test.json',

'has_gt': True,
'class_names': ('can'),
'label_map':  { 1: 1}
cans_config = yolact_darknet53_config.copy({
'name': 'cans',

'dataset': cans_dataset,
'num_classes': len(cans_dataset.class_names) + 1,

'max_size': 500,

# Training params
'lr_steps': (8000, 9000),
'max_iter': 10000,