I know there is a silly answer for this but I am still unable to use plot_results() function in yolov5. Here is my code
from utils.general import plot_results
plot_results()
and it gives me the error message: No handles with labels found to put in legend.
@redwankarimsony you point it to the directory containing the results.txt you want to plot:
https://github.com/ultralytics/yolov5/blob/4d3680c81dad760e5d1ffe397ab2fc9169d9fb70/utils/general.py#L1275
For example:
plot_results(save_dir='runs/exp0')
Thanks a lot @glenn-jocher
Hi,
I do as you said plot_results(save_dir='runs/exp_1') but I have the same error 'No handles with labels found to put in legend'
Do the names of predict labels and true labels have to have a specific name ?
Thank you
@constantinfite git pull to update your code and make sure you have actual results.txt files in the directory you are pointing to.
@glenn-jocher My files are like this

I don't have a results.txt file, this file regroups all the txt files ?
@constantinfite right.
plot_results() plots results.txt files.
You may want to start with the custom training tutorial, it explains all of this for new users:
https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data
Yes I was thinking that plot_results taking inference output but it's only validation output
thanks anyway @glenn-jocher
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
@redwankarimsony you point it to the directory containing the results.txt you want to plot:
https://github.com/ultralytics/yolov5/blob/4d3680c81dad760e5d1ffe397ab2fc9169d9fb70/utils/general.py#L1275
For example:
plot_results(save_dir='runs/exp0')