stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: TypeError: list indices must be integers or slices, not str

Open illuculent opened this issue 1 year ago • 10 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

Traceback (most recent call last): File "C:\stable-diffusion\Packages\stable-diffusion-webui\modules\hypernetworks\hypernetwork.py", line 701, in train_hypernetwork p.sampler_name = sd_samplers.samplers[preview_sampler_index].name TypeError: list indices must be integers or slices, not str

Claims this is fixed and closed but I still get this issue. I have the latest update to auto1111. AUTOMATIC1111 deleted the fix-preview-while-generation branch 2 weeks ago. It appears the fix was merged and then deleted so I cannot determine what the fix was. I have tried everything that was suggested within github that I could find to fix this and it is still a no go situation.

Steps to reproduce the problem

click 'Train Hypernetwork' with 'Read parameters (prompt, etc...) from txt2img tab when making previews' checked.

What should have happened?

Trained Hypernetwork

Sysinfo

sysinfo-2023-09-24-21-22.txt

What browsers do you use to access the UI ?

Google Chrome

Console logs

[1.0, 2.0, 1.0]
Calculating sha256 for C:\stable-diffusion\Packages\stable-diffusion-webui\models\hypernetworks\MegaVeg.pt: 446e43d33c8e821d87131b8ceedd24d15f2f2353e3a643daa5d9901a11098840
No saved optimizer exists in checkpoint
Training at rate of 1e-05 until step 10000
Preparing dataset...
100%|##########| 256/256 [00:08<00:00, 29.73it/s]
Training hypernetwork [Epoch 3: 116/128]loss: 0.5373685:   1%|          | 50/9551 [00:11<38:29,  4.11it/s]*** Exception in training hypernetwork
    Traceback (most recent call last):
      File "C:\stable-diffusion\Packages\stable-diffusion-webui\modules\hypernetworks\hypernetwork.py", line 701, in train_hypernetwork
        p.sampler_name = sd_samplers.samplers[preview_sampler_index].name
    TypeError: list indices must be integers or slices, not str

---
                                                                                                          Applying attention optimization: xformers... done.

Additional information

No response

illuculent avatar Sep 24 '23 21:09 illuculent

Same issue here, using different browser (firefox) but getting the same error in the same way.

etherminor avatar Sep 27 '23 00:09 etherminor

Also check this related BUG: https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/13439

B-Hard avatar Sep 29 '23 09:09 B-Hard

I have the same issue

Lperke avatar Nov 01 '23 14:11 Lperke

Same issue

DavidCodesDev avatar Dec 01 '23 17:12 DavidCodesDev

Same here, any workaround? Workaround is to disable Read parameters from img2img checkbox

ivanstepanovftw avatar Dec 02 '23 01:12 ivanstepanovftw

Same here, any workaround? Workaround is to disable Read parameters from img2img checkbox

your my hero, mate I basically went crazy over this, finally found your soultion and it works...but why??

psychonaut97 avatar Dec 06 '23 13:12 psychonaut97

Same here, any workaround? Workaround is to disable Read parameters from img2img checkbox

your my hero, mate I basically went crazy over this, finally found your soultion and it works...but why??

Where is this in the current branch; I have this same issue, but I can't seem to find a checkbox associated with "Read Parameters"

knight-captain avatar Apr 02 '24 23:04 knight-captain