Error in RoboflowEvaluator

I need help with RoboflowEvaluator. I am trying to evaluate a computer vision model using cvevals by following this vlog, How to Evaluate Computer Vision Models with CVevals

This is my code which I erased my API key for privacy:

import argparse
import os

from roboflow import Roboflow
from evaluations.dataloaders import (RoboflowDataLoader,
from evaluations.roboflow import RoboflowEvaluator

rf = Roboflow(api_key=“”)
project = rf.workspace().project(“final-grape-leaf-disease-detection-and-classification”)
model = project.version(15).model

EVAL_DATA_PATH = “/Users/green/OneDrive/Desktop/Code/YOLOFORPYTHON/data”
ROBOFLOW_PROJECT_URL = “final-grape-leaf-disease-detection-and-classification”
class_names = [“Healthy”, “Birds_Eye_Rot”, “Powdery_Mildew”]

class_names, data, model = RoboflowDataLoader(

predictions = RoboflowPredictionsDataLoader(

evaluator = RoboflowEvaluator(
ground_truth=data, predictions=predictions, class_names=class_names, mode=“batch”

cf = evaluator.eval_model_predictions()


data = evaluator.calculate_statistics()

print(“Precision:”, data.precision)
print(“Recall:”, data.recall)
print(“f1 Score:”, data.f1)

I keep getting this error:
Exception has occurred: KeyError
File “C:\Users\green\OneDrive\Desktop\Code\”, line 35, in
evaluator = RoboflowEvaluator(
KeyError: ‘images\20230717_093620_jpg.rf.efbf9b981bda623c03ff65b3c8a52612.jpg’

The image shown on the error is the first image of my dataset. What can I do to solve this issue? I have tried combining both the txt files and image files into one folder (One folder for test, one folder for train, and one folder for valid). For reference I will attach a pic.

Based on the information provided in the extracts, it seems like the error you’re encountering might be related to the file path of your images. The error message KeyError: 'images\\20230717_093620_jpg.rf.efbf9b981bda623c03ff65b3c8a52612.jpg' suggests that the script is unable to locate the image file at the specified path.

In the Roboflow CVevals Documentation, it is mentioned that you need to specify a source from which to load your ground truth data and a source from which to load model predictions. In your case, it seems like the EVAL_DATA_PATH is the source for your ground truth data.

You might want to double-check the following:

  1. Ensure that the EVAL_DATA_PATH is correctly pointing to the directory where your images are stored. The path should be absolute and not relative.

  2. Verify that the image file ‘20230717_093620_jpg.rf.efbf9b981bda623c03ff65b3c8a52612.jpg’ indeed exists in the specified directory.

  3. Check if the file paths in your dataset are consistent with the actual file paths. For instance, if your dataset contains file paths with forward slashes (/), but your operating system uses backslashes (\), this could cause issues.

If you continue to face issues, you might want to refer back to the Roboflow CVevals Documentation or the Roboflow Blog for more detailed instructions and examples.

Hi! I’m Roboflow’s AI powered bot. This is an automated response powered using AI with knowledge from our docs, blog, knowledge base, and previous forum responses. If you find this to be a helpful answer, please mark it as the solution using the checkbox icon below. If this doesn’t solve your issue, please follow up with what you’ve tried/why, and the community will continue to chime in as usual.

I have tried the recommendations of the ai bot but the code still does not work, what are the other solutions that I can try?