python
1Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)] on win32 2Type "help", "copyright", "credits" or "license" for more information. 3>>> from diffusers import DiffusionPipeline 4>>> 5>>> model_id = "CompVis/ldm-text2im-large-256" 6>>> 7>>> # load model and scheduler 8>>> ldm = DiffusionPipeline.from_pretrained(model_id) 9Fetching 11 files: 100%|█████████████████| 11/11 [00:00<00:00, 5503.68it/s] 10The config attributes {'timestep_values': None} were passed to DDIMScheduler, but are not expected and will be ignored. Please verify your scheduler_config.json configuration file. 11>>> 12>>> # run pipeline in inference (sample random noise and denoise) 13>>> prompt = "A painting of a squirrel eating a burger" 14>>> images = ldm([prompt], num_inference_steps=50, eta=0.3, guidance_scale=6)["sample"] 15100%|██████████████████████████████████████| 50/50 [01:29<00:00, 1.78s/it] 16Traceback (most recent call last): 17 File "<stdin>", line 1, in <module> 18 File "C:\Users\〇〇\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\utils\outputs.py", line 88, in __getitem__ 19 return inner_dict[k] 20KeyError: 'sample'
以上のような表示が出ました。どこを直したらKeyErrorがなくなるでしょうか。
初心者ですので質問が分かりにくいと思いますが何卒よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー