notebooks icon indicating copy to clipboard operation
notebooks copied to clipboard

DETR Notebook "Name Error Image_Processor is not defined"

Open Satyajit1993 opened this issue 2 years ago • 3 comments

After running this block, I am getting "Name Error image_processor is not defined"

TRAIN_DATASET = CocoDetection(image_directory_path=TRAIN_DIRECTORY, image_processor=image_processor, train=True) VAL_DATASET = CocoDetection(image_directory_path=VAL_DIRECTORY, image_processor=image_processor, train=False) TEST_DATASET = CocoDetection(image_directory_path=TEST_DIRECTORY, image_processor=image_processor, train=False)

Kindly Help

Satyajit1993 avatar Sep 06 '23 05:09 Satyajit1993

👋 Hello @Satyajit1993, thank you for leaving an issue on Roboflow Notebooks.

🐞 Bug reports

If you are filing a bug report, please be as detailed as possible. This will help us more easily diagnose and resolve the problem you are facing. To learn more about contributing, check out our Contributing Guidelines.

If you require support with custom code that is not part of Roboflow Notebooks, please reach out on the Roboflow Forum or on the GitHub Discussions page associated with this repository.

💬 Get in touch

Do you have more questions about Roboflow that we haven't responded to yet? Feel free to ask them on the Roboflow Discuss forum. Our developer advocates and community team actively respond to questions there.

To ask questions about Notebooks, head over to the GitHub Discussions section of this repository.

github-actions[bot] avatar Sep 06 '23 05:09 github-actions[bot]

As you are going to use pre-trained DETR from transformers , you can import it like this: from transformers import DetrImageProcessor image_processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")

Hope this helps!

MoAKgit avatar Sep 21 '23 01:09 MoAKgit

After running this block, I am getting "Name Error image_processor is not defined"

TRAIN_DATASET = CocoDetection(image_directory_path=TRAIN_DIRECTORY, image_processor=image_processor, train=True) VAL_DATASET = CocoDetection(image_directory_path=VAL_DIRECTORY, image_processor=image_processor, train=False) TEST_DATASET = CocoDetection(image_directory_path=TEST_DIRECTORY, image_processor=image_processor, train=False)

Kindly Help

As you are going to use pre-trained DETR from transformers , you can import it like this: from transformers import DetrImageProcessor image_processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")

Hope this helps!

MoAKgit avatar Sep 21 '23 01:09 MoAKgit