赞
踩
结论:把左上角sd大模型换成不带xl的版本,比如v1-5版本或v2-1版本。
背景:
突然也是心血来潮想自己训练个模型,跟着b站@Nenly大佬的一个视频先做个老黄的embeddings模型训练(那视频质量确实高,相信会有很多人看),结果到了创建嵌入式模型这一步死活报错。
错误代码如下:
- Traceback (most recent call last):
- File "D:\software\sd-webui-aki\sd-webui-aki-v4.4\python\lib\site-packages\gradio\routes.py", line 488, in run_predict
- output = await app.get_blocks().process_api(
- File "D:\software\sd-webui-aki\sd-webui-aki-v4.4\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api
- result = await self.call_function(
- File "D:\software\sd-webui-aki\sd-webui-aki-v4.4\python\lib\site-packages\gradio\blocks.py", line 1103, in call_function
- prediction = await anyio.to_thread.run_sync(
- File "D:\software\sd-webui-aki\sd-webui-aki-v4.4\python\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
- return await get_asynclib().run_sync_in_worker_thread(
- File "D:\software\sd-webui-aki\sd-webui-aki-v4.4\python\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
- return await future
- File "D:\software\sd-webui-aki\sd-webui-aki-v4.4\python\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
- result = context.run(func, *args)
- File "D:\software\sd-webui-aki\sd-webui-aki-v4.4\python\lib\site-packages\gradio\utils.py", line 707, in wrapper
- response = f(*args, **kwargs)
- File "D:\software\sd-webui-aki\sd-webui-aki-v4.4\modules\textual_inversion\ui.py", line 10, in create_embedding
- filename = modules.textual_inversion.textual_inversion.create_embedding(name, nvpt, overwrite_old, init_text=initialization_text)
- File "D:\software\sd-webui-aki\sd-webui-aki-v4.4\modules\textual_inversion\textual_inversion.py", line 259, in create_embedding
- cond_model([""]) # will send cond model to GPU if lowvram/medvram is active
- File "D:\software\sd-webui-aki\sd-webui-aki-v4.4\python\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
- return forward_call(*args, **kwargs)
- File "D:\software\sd-webui-aki\sd-webui-aki-v4.4\repositories\generative-models\sgm\modules\encoders\modules.py", line 141, in forward
- emb_out = embedder(batch[embedder.input_key])
- TypeError: list indices must be integers or slices, not str
折腾了半天,很少有人提到这个问题,基本都是python编程圈的,这开源代码+秋葉大佬启动器我何德何能去改代码错误?
于是我尝试换版本,不行;关掉所有插件,不行;检查路径确保没有中文,不行。偶尔在一些地方碰到有提到此问题的,也是无解不了了之,整得好像大多数人都没遇到这个错误,可我啥都没设置啊!真够绝望的
最后终于终于终于在wai网里找到了一个解决方法:[Bug]: Exception when trying to create an embedding on Train tab · Issue #12344 · AUTOMATIC1111/stable-diffusion-webui · GitHub
具体内容看不太懂,但隐约从字眼里行间看到说选xl模型不太行。本来我是想不到创建个空嵌入式模型和大模型有啥关系,因为明明还没开始训练,就没往这方面想过。结果换完发现真的好了!!
第一次发文章,感觉csdn点赞经常少的一批(虽然我也不知道多了有啥用),如果有帮到不妨点个赞!!!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。