GaParmar / img2img-turbo

One-step image-to-image with Stable Diffusion turbo: sketch2image, day2night, and more
MIT License
1.65k stars 189 forks source link

ValueError: Unrecognized model in /root/autodl-tmp/img2img-turbo-main/tokenizer. Should have a `model_type` key in its config.json, or contain one of the following strings in its name #89

Open YijiFeng opened 1 month ago

YijiFeng commented 1 month ago

My server cannot connect to the Hugging Face website, so I manually downloaded the pretrained model used in the code and placed it in the img2img-turbo-main folder. After executing the command python src/inference_unpaired.py --model_name "day_to_night" --input_image "assets/examples/day2night_input.png" --output_dir "outputs", the following error occurred: Traceback (most recent call last): File "/root/autodl-tmp/img2img-turbo-main/src/inference_unpaired.py", line 34, in model = CycleGAN_Turbo(pretrained_name=args.model_name, pretrained_path=args.model_path) File "/root/autodl-tmp/img2img-turbo-main/src/cyclegan_turbo.py", line 121, in init self.tokenizer = AutoTokenizer.from_pretrained(model_name_tokenizer) File "/root/miniconda3/envs/img2img-turbo/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py", line 733, in from_pretrained config = AutoConfig.from_pretrained( File "/root/miniconda3/envs/img2img-turbo/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 1073, in from_pretrained raise ValueError( ValueError: Unrecognized model in /root/autodl-tmp/img2img-turbo-main/tokenizer. Should have a model_type key in its config.json, or contain one of the following strings in its name: albert, align, altclip, audio-spectrogram-transformer, autoformer, bark, bart, beit, bert, bert-generation, big_bird, bigbird_pegasus, biogpt, bit, blenderbot, blenderbot-small, blip, blip-2, bloom, bridgetower, bros, camembert, canine, chinese_clip, clap, clip, clipseg, code_llama, codegen, conditional_detr, convbert, convnext, convnextv2, cpmant, ctrl, cvt, data2vec-audio, data2vec-text, data2vec-vision, deberta, deberta-v2, decision_transformer, deformable_detr, deit, deta, detr, dinat, dinov2, distilbert, donut-swin, dpr, dpt, efficientformer, efficientnet, electra, encodec, encoder-decoder, ernie, ernie_m, esm, falcon, flaubert, flava, fnet, focalnet, fsmt, funnel, fuyu, git, glpn, gpt-sw3, gpt2, gpt_bigcode, gpt_neo, gpt_neox, gpt_neox_japanese, gptj, gptsan-japanese, graphormer, groupvit, hubert, ibert, idefics, imagegpt, informer, instructblip, jukebox, kosmos-2, layoutlm, layoutlmv2, layoutlmv3, led, levit, lilt, llama, longformer, longt5, luke, lxmert, m2m_100, marian, markuplm, mask2former, maskformer, maskformer-swin, mbart, mctct, mega, megatron-bert, mgp-str, mistral, mobilebert, mobilenet_v1, mobilenet_v2, mobilevit, mobilevitv2, mpnet, mpt, mra, mt5, musicgen, mvp, nat, nezha, nllb-moe, nougat, nystromformer, oneformer, open-llama, openai-gpt, opt, owlv2, owlvit, pegasus, pegasus_x, perceiver, persimmon, pix2struct, plbart, poolformer, pop2piano, prophetnet, pvt, qdqbert, rag, realm, reformer, regnet, rembert, resnet, retribert, roberta, roberta-prelayernorm, roc_bert, roformer, rwkv, sam, seamless_m4t, segformer, sew, sew-d, speech-encoder-decoder, speech_to_text, speech_to_text_2, speecht5, splinter, squeezebert, swiftformer, swin, swin2sr, swinv2, switch_transformers, t5, table-transformer, tapas, time_series_transformer, timesformer, timm_backbone, trajectory_transformer, transfo-xl, trocr, tvlt, umt5, unispeech, unispeech-sat, upernet, van, videomae, vilt, vision-encoder-decoder, vision-text-dual-encoder, visual_bert, vit, vit_hybrid, vit_mae, vit_msn, vitdet, vitmatte, vits, vivit, wav2vec2, wav2vec2-conformer, wavlm, whisper, xclip, xglm, xlm, xlm-prophetnet, xlm-roberta, xlm-roberta-xl, xlnet, xmod, yolos, yoso

YijiFeng commented 1 month ago

Does anyone can help me solve this problem? thank you very much

YijiFeng commented 1 month ago

Oh~I have resolved this problem

sun11711 commented 3 weeks ago

I also encountered the same problem, how did you solve it?

sun11711 commented 3 weeks ago

![Uploading 微信截图_20241024143146.png…]()