depthmap2mask icon indicating copy to clipboard operation
depthmap2mask copied to clipboard

TypeError: argument of type 'NoneType' is not iterable

Open bypaulomeyer opened this issue 2 years ago • 7 comments

What's up guys. I'm having trouble using Depthmap2mask. I can install as instructed by github. When I go to img2img, enable Depthmap2mask and enable dpt_large, the following error appears in the CMD: File "C:\Users\bypau\Desktop\SD\stable-diffusion-webui\repositories\midas\midas\base_model.py", line 13, in load if "optimizer" in parameters: TypeError: argument of type 'NoneType' is not iterable

When I select another model other than dpt_large it works. The problem is only in dpt_large.

I am very grateful to everyone who can help me.

bypaulomeyer avatar May 23 '23 17:05 bypaulomeyer

What's up guys. I'm having trouble using Depthmap2mask. I can install as instructed by github. When I go to img2img, enable Depthmap2mask and enable dpt_large, the following error appears in the CMD: File "C:\Users\bypau\Desktop\SD\stable-diffusion-webui\repositories\midas\midas\base_model.py", line 13, in load if "optimizer" in parameters: TypeError: argument of type 'NoneType' is not iterable

When I select another model other than dpt_large it works. The problem is only in dpt_large.

I am very grateful to everyone who can help me.

I ended up discovering the problem. The dpt_large file is not downloading automatically. I got the file from github and put it in the folder manually and that way it worked correctly.

bypaulomeyer avatar May 24 '23 12:05 bypaulomeyer

can you give a link pls? And what dpt_larde is it? dozens of them...

Danmangust avatar May 27 '23 03:05 Danmangust

você pode dar um link pls? E o que dpt_larde é? dezenas deles...

Claro.

https://github.com/isl-org/MiDaS/releases/download/v3/dpt_large_384.pt

bypaulomeyer avatar May 27 '23 23:05 bypaulomeyer

Hello. Need help. The depthmap2mask extension doesn't work for me. I installed from the link in stable diffusion and downloaded the archive separately by placing it in the stable diffusion folder. Nothing helped me. None of the models work.

Writes the following error. *** Error completing request *** Arguments: ('task(t3txrnzq6eou7r2)', 0, 'dead pool', '', [], <PIL.Image.Image image mode=RGBA size=512x512 at 0x15873919BD0>, None, None, None, None , None, None, 20, 0, 4, 0, 1, False, False, 1, 1, 7, 1.5, 0, -1.0, -1.0, 0, 0, 0, False, 0, 512, 512, 1 , 0, 0, 32, 0, '', '', '', [], 9, False, '', <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x0000015A211E1BA0>, '

    \n
  • CFG Scale should be 2 or lower.
  • \n
\n', True, True, '', '', True, 50, True, 1, 0, False , 4, 0.5, 'Linear', 'None', '

Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8

', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down' ], False, False, 'positive', 'comma', 0, False, False, '', '

Will upscale the image by the selected scale factor; use width and height sliders to set tile size

', 64, 0, 2, 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False, 7, False, 512, 512, True, 9, True, True, False, False, None, None, False, 50) {} Traceback (most recent call last): File "C:\Users\User\Downloads\sd.webui\webui\modules\call_queue.py", line 55, in f res = list(func(*args, **kwargs)) File "C:\Users\User\Downloads\sd.webui\webui\modules\call_queue.py", line 35, in f res = func(*args, **kwargs) File "C:\Users\User\Downloads\sd.webui\webui\modules\img2img.py", line 196, in img2img processed = modules.scripts.scripts_img2img.run(p, *args) File "C:\Users\User\Downloads\sd.webui\webui\modules\scripts.py", line 456, in run processed = script.run(p, *script_args) File "C:\Users\User\Downloads\sd.webui\webui\extensions\depthmap2mask-main\scripts\depth2image_depthmask.py", line 97, in run d_m = sdmg.calculate_depth_maps(p.init_images[0],img_x,img_y,model_type,invert_depth) File "C:\Users\User\Downloads\sd.webui\webui\extensions/depthmap2mask/scripts/depthmap_for_depth2img.py", line 294, in calculate_depth_maps model, transform = load_model(device, model_path, models[model_type_index], (img_x, img_y)) File "C:\Users\User\Downloads\sd.webui\webui\extensions/depthmap2mask/scripts/depthmap_for_depth2img.py", line 142, in load_model model = DPTDepthModel( File "C:\Users\User\Downloads\sd.webui\webui\repositories\midas\midas\dpt_depth.py", line 163, in init self.load(path) File "C:\Users\User\Downloads\sd.webui\webui\repositories\midas\midas\base_model.py", line 13, in load if "optimizer" in parameters: TypeError: argument of type 'NoneType' is not iterable

image

Dlesserko avatar Jul 19 '23 11:07 Dlesserko

você pode dar um link pls? E o que dpt_larde é? dezenas deles...

Claro.

https://github.com/isl-org/MiDaS/releases/download/v3/dpt_large_384.pt

Thanks alot! Where exactly to place this file? Can you share the path?

Sergei-beep avatar Jul 27 '23 07:07 Sergei-beep

Hello. Current version of Midas is v3.1 and dpt_large_384.pt is marked as legacy. You can try to use dpt_beit_large_512/dpt_beit_large_384. Source (https://github.com/isl-org/MiDaS)

It worked for me perfectly fine. But previously I was getting same error: TypeError: argument of type 'NoneType' is not iterable

Latishock avatar Aug 07 '23 15:08 Latishock

AttributeError: 'Block' object has no attribute 'drop_path' who knows what can it be?

thekotfather avatar Nov 02 '23 13:11 thekotfather