Hello everybody,
im new with huggingface and wanted to try out the object detection. So i ran the transformers object detection example from the huggingface docs (this one here: Object detection) and wanted to add some metrics while training the model. Everytime i get the following error:
TypeError: Can’t pad the values of type <class ‘transformers.image_processing_utils.BatchFeature’>, only of nested list/tuple/dicts of tensors.
I create a eval_dataset like this:
cppe5["test"] = cppe5["test"].with_transform(transform_aug_ann)
and add it to the trainer:
metric = evaluate.load("accuracy")
def compute_metrics(eval_pred):
print("here")
logits, labels = eval_pred
predictions = np.argmax(logits, axis=-1)
return metric.compute(predictions=predictions, references=labels)
trainer = Trainer(
model=model,
args=training_args,
data_collator=collate_fn,
train_dataset=splitted_ds_encoded["train"],
eval_dataset=splitted_ds_encoded['test'],
tokenizer=image_processor,
compute_metrics=compute_metrics,
)
Maybe someone here can help me?
Thanks in advance. Greetings Christoph