AutoImageProcessor cannot load facebook/dinov2-base
Traceback (most recent call last):
File "/data/users/public/huggingface_api_learn/src/peft_benchmark/train_cifar100_fine_by_lora.py", line 39, in
image_processor = AutoImageProcessor.from_pretrained(model_checkpoint, use_fast=True)
File "/home/yecm/anaconda3/envs/hf_ai/lib/python3.10/site-packages/transformers/models/auto/image_processing_auto.py", line 485, in from_pretrained
raise ValueError(
ValueError: Unrecognized image processor in facebook/dinov2-small. Should have a image_processor_type
key in its preprocessor_config.json of config.json, or one of the following model_type
keys in its config.json: align, beit, bit, blip, blip-2, bridgetower, chinese_clip, clip, clipseg, conditional_detr, convnext, convnextv2, cvt, data2vec-vision, deformable_detr, deit, depth_anything, deta, detr, dinat, dinov2, donut-swin, dpt, efficientformer, efficientnet, flava, focalnet, fuyu, git, glpn, grounding-dino, groupvit, idefics, idefics2, imagegpt, instructblip, instructblipvideo, kosmos-2, layoutlmv2, layoutlmv3, levit, llava, llava-next-video, llava_next, mask2former, maskformer, mgp-str, mobilenet_v1, mobilenet_v2, mobilevit, mobilevitv2, nat, nougat, oneformer, owlv2, owlvit, perceiver, pix2struct, poolformer, pvt, pvt_v2, regnet, resnet, rt_detr, sam, segformer, seggpt, siglip, swiftformer, swin, swin2sr, swinv2, table-transformer, timesformer, tvlt, tvp, udop, upernet, van, videomae, vilt, vipllava, vit, vit_hybrid, vit_mae, vit_msn, vitmatte, xclip, yolos
Hi,
DINOv2 does not have a fast image processor yet, so you should just use:
from transformers import AutoImageProcessor
image_processor = AutoImageProcessor.from_pretrained("facebook/dinov2-base")