Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6476 Discussions

Error when fine tuning the horizontal text detection

Kai28
Beginner
1,578 Views

Hi, I encounter this error when I am running the fine-tuning step in https://github.com/openvinotoolkit/training_extensions/tree/misc/models/object_detection/model_templates/horizontal-text-detection Step 4.b. Evaluate

Traceback (most recent call last):
File "/home/tham/training_extensions/external/mmdetection/tools/test.py", line 260, in
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-10.2'
main()
File "/home/tham/training_extensions/external/mmdetection/tools/test.py", line 175, in main
dataset = build_dataset(cfg.data.test)
File "/home/tham/training_extensions/external/mmdetection/mmdet/datasets/builder.py", line 108, in build_dataset
raise RuntimeError(f'Failed to find annotation files that match pattern: '
RuntimeError: Failed to find annotation files that match pattern: /data/horizontal_text_detection/annotation.json
Traceback (most recent call last):
File "eval.py", line 46, in
main()
File "eval.py", line 42, in main
evaluator(**eval_args)
File "/home/tham/training_extensions/ote/ote/modules/evaluators/base.py", line 38, in call
self._evaluate_internal(config, snapshot, out, update_config, metrics_functions, **kwargs)
File "/home/tham/training_extensions/ote/ote/modules/evaluators/base.py", line 62, in _evaluate_internal
metrics.extend(func(**metric_args))
File "/home/tham/training_extensions/ote/ote/metrics/horizontal_text_detection/horizontal_text_detection.py", line 68, in coco_eval
'key': 'f1', 'value': hmean[2] * 100, 'unit': '%', 'display_name': 'F1-score'
IndexError: list index out of range

Can anyone help me to verify, thank you.

0 Kudos
6 Replies
Zulkifli_Intel
Moderator
1,540 Views

Hi Kai28,

 

Thank you for reaching out to us.

 

Please share with us your environment detail such as the Ubuntu version, Python version, and all necessary information that can help us to investigate this issue further.

 

Sincerely,

Zulkifli 


0 Kudos
Kai28
Beginner
1,518 Views

Hi @Zulkifli_Intel 

Thanks for replying my post, here is my environment details.


OS: Ubuntu 18.04
Python 3.6.9
CUDA 10.2
Openvino toolkit 2021.4.582
4.5.3-openvino

I also attached my pip list txt file.

0 Kudos
Megat_Intel
Moderator
1,503 Views

Hi Kai28,

Thank you for providing the details.

 

For your information, I was able to replicate a similar error when running the Fine Tune evaluation code for Horizontal Text Detection. I share my error messages here:

 error .png

 

The above error was because I specify the wrong "TEST_IMG_ROOT" directory. After ensuring the directory was correct, I was able to run the evaluation as shown below:

 success .png

 

Based on your error message ("RuntimeError: Failed to find annotation files that match pattern: /data/horizontal_text_detection/annotation.json"), I believe the error is because the "annotation.json" file was unable to be located. Please ensure that the annotation files and the images root directory are configured correctly.

 

On the other hand, I did not use an NVIDIA GPU, therefore, I did not receive the error ("No CUDA runtime is found"). Have you tried the command below and see if it works to solve the GPU issue:

export FORCE_CUDA="1"

 

 

Regards,

Megat

 

0 Kudos
Kai28
Beginner
1,456 Views

Hi @Megat_Intel 

Thanks for the assistance. The error "RuntimeError: Failed to find annotation files that match pattern: /data/horizontal_text_detection/annotation.json" is solved and able to get the same result as yours.

 

About the "No CUDA runtime is found" error message, it was still there and I didn't use NVIDIA GPU as well. As I am able to run the evaluation I guess it doesn't matter?

0 Kudos
Megat_Intel
Moderator
1,412 Views

Hi Kai28,

I'm glad to know that you are able to solve your issue.

 

For your information, the "No CUDA runtime is found" message is likely just a warning message given that the NVIDIA GPU can be used for model training. Do you have CUDA installed on your machine?

 

Since you are not using an NVIDIA GPU in your system, maybe you can try to remove the CUDA Toolkit and see if it solves the warning messages. You can check out the guide on How to remove Cuda completely from Ubuntu (This is an external link and is not maintained by Intel).

 

 

Regards,

Megat

 

0 Kudos
Megat_Intel
Moderator
1,337 Views

Hi Kai28,

This thread will no longer be monitored since we have provided a suggestion. If you need any additional information from Intel, please submit a new question.

 

 

Regards,

Megat


0 Kudos
Reply