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

AttributeError: 'NoneType' object has no attribute 'text' #12

Open
EverlastingYeay opened this issue Sep 23, 2024 · 0 comments
Open

AttributeError: 'NoneType' object has no attribute 'text' #12

EverlastingYeay opened this issue Sep 23, 2024 · 0 comments

Comments

@EverlastingYeay
Copy link

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
launch(
File "d:\wyl\detectron2\detectron2\engine\launch.py", line 84, in launch
main_func(*args)
File "D:\wyl\ProbabilisticTeacher\train_net.py", line 83, in main
return trainer.train()
File "D:\wyl\ProbabilisticTeacher\pt\engine\trainer.py", line 149, in train
self.train_loop(self.start_iter, self.max_iter)
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'

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

1 participant