ProbabilisticTeacher
ProbabilisticTeacher copied to clipboard
AttributeError: 'NoneType' object has no attribute 'text'
I encountered an issue during the evaluation phase that seems related to the missing pose attribute in the Pascal VOC XML files.Is there a specific way the parse_rec function or Pascal VOC evaluation is expected to handle missing tags such as pose? The complete error message is as follows:
Exception during training:
Traceback (most recent call last):
File "D:\wyl\ProbabilisticTeacher\pt\engine\trainer.py", line 169, in train_loop
self.after_step()
File "d:\wyl\detectron2\detectron2\engine\train_loop.py", line 190, in after_step
h.after_step()
File "d:\wyl\detectron2\detectron2\engine\hooks.py", line 556, in after_step
self._do_eval()
File "d:\wyl\detectron2\detectron2\engine\hooks.py", line 529, in _do_eval
results = self._func()
File "D:\wyl\ProbabilisticTeacher\pt\engine\trainer.py", line 530, in test_and_save_results_student
self._last_eval_results_student = self.test(self.cfg, self.model)
File "d:\wyl\detectron2\detectron2\engine\defaults.py", line 621, in test
results_i = inference_on_dataset(model, data_loader, evaluator)
File "d:\wyl\detectron2\detectron2\evaluation\evaluator.py", line 213, in inference_on_dataset
results = evaluator.evaluate()
File "d:\wyl\detectron2\detectron2\evaluation\pascal_voc_evaluation.py", line 102, in evaluate
rec, prec, ap = voc_eval(
File "d:\wyl\detectron2\detectron2\evaluation\pascal_voc_evaluation.py", line 220, in voc_eval
recs[imagename] = parse_rec(annopath.format(imagename))
File "d:\wyl\detectron2\detectron2\evaluation\pascal_voc_evaluation.py", line 140, in parse_rec
obj_struct["pose"] = obj.find("pose").text
AttributeError: 'NoneType' object has no attribute 'text'
[09/19 22:16:10 d2.engine.hooks]: Overall training speed: 397 iterations in 0:35:28 (5.3602 s / it)
[09/19 22:16:10 d2.engine.hooks]: Total training time: 0:35:49 (0:00:21 on hooks)
[09/19 22:16:10 d2.utils.events]: eta: 1 day, 18:34:44 iter: 399 total_loss: 1.878 loss_cls: 0.2528 loss_box_reg: 0.3435 loss_rpn_cls: 0.2276 loss_rpn_loc: 1.089 time: 5.3468 last_time: 5.0917 data_time: 0.3437 last_data_time: 0.3814 lr: 0.01596 max_mem: 9427M
Traceback (most recent call last):
File "D:\wyl\ProbabilisticTeacher\train_net.py", line 90, in