[Error] Unable to infer channel dimension format

I’m trying to fine-tuning the facebook/detr-resnet-50 with an existing dataset from hugging_face, but i got Unable to infer channel dimension format
This is my code:

from datasets import load_dataset
from transformers import DetrImageProcessor

dataset = load_dataset("arjunpatel1234/Recipe_Ingredients")
tokenizer  = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")

def tokenize_function(examples):
    print(examples["image"])
    image_features = tokenizer(examples["image"], truncation=True)
    print(image_features)
    return image_features


tokenized_datasets = dataset.map(tokenize_function)

I get this error:

raise ValueError("Unable to infer channel dimension format")
ValueError: Unable to infer channel dimension format

Could you print the shape of image? Make sure you are passing an image and not the path of image in the dataset.