Diffusers
Safetensors
StableDiffusionUpscalePipeline
stable-diffusion

Error in DeepFloyd IF - Stability AI's x4 Upscaler

#20
by aschunem - opened

Hi,

I'm a first time user, so I'm running through the simple demo (deepfloyd_if_free_tier_google_colab.ipynb). It fails in the last step (1.6) with the following message:

β”‚ in <cell line: 1>:1 β”‚
β”‚ β”‚
β”‚ /usr/local/lib/python3.10/dist-packages/diffusers/pipelines/pipeline_utils.py:1063 in β”‚
β”‚ from_pretrained β”‚
β”‚ β”‚
β”‚ 1060 β”‚ β”‚ β”‚ β”‚ loaded_sub_model = passed_class_obj[name] β”‚
β”‚ 1061 β”‚ β”‚ β”‚ else: β”‚
β”‚ 1062 β”‚ β”‚ β”‚ β”‚ # load sub model β”‚
β”‚ ❱ 1063 β”‚ β”‚ β”‚ β”‚ loaded_sub_model = load_sub_model( β”‚
β”‚ 1064 β”‚ β”‚ β”‚ β”‚ β”‚ library_name=library_name, β”‚
β”‚ 1065 β”‚ β”‚ β”‚ β”‚ β”‚ class_name=class_name, β”‚
β”‚ 1066 β”‚ β”‚ β”‚ β”‚ β”‚ importable_classes=importable_classes, β”‚
β”‚ β”‚
β”‚ /usr/local/lib/python3.10/dist-packages/diffusers/pipelines/pipeline_utils.py:451 in β”‚
β”‚ load_sub_model β”‚
β”‚ β”‚
β”‚ 448 β”‚ β”‚
β”‚ 449 β”‚ # check if the module is in a subdirectory β”‚
β”‚ 450 β”‚ if os.path.isdir(os.path.join(cached_folder, name)): β”‚
β”‚ ❱ 451 β”‚ β”‚ loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwar β”‚
β”‚ 452 β”‚ else: β”‚
β”‚ 453 β”‚ β”‚ # else load from the root directory β”‚
β”‚ 454 β”‚ β”‚ loaded_sub_model = load_method(cached_folder, **loading_kwargs) β”‚
β”‚ β”‚
β”‚ /usr/local/lib/python3.10/dist-packages/diffusers/models/modeling_utils.py:649 in β”‚
β”‚ from_pretrained β”‚
β”‚ β”‚
β”‚ 646 β”‚ β”‚ β”‚ β”‚ else: # else let accelerate handle loading and dispatching. β”‚
β”‚ 647 β”‚ β”‚ β”‚ β”‚ β”‚ # Load weights and dispatch according to the device_map β”‚
β”‚ 648 β”‚ β”‚ β”‚ β”‚ β”‚ # by default the device_map is None and the weights are loaded on th β”‚
β”‚ ❱ 649 β”‚ β”‚ β”‚ β”‚ β”‚ accelerate.load_checkpoint_and_dispatch( β”‚
β”‚ 650 β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ model, β”‚
β”‚ 651 β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ model_file, β”‚
β”‚ 652 β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ device_map, β”‚
β”‚ β”‚
β”‚ /usr/local/lib/python3.10/dist-packages/accelerate/big_modeling.py:486 in β”‚
β”‚ load_checkpoint_and_dispatch β”‚
β”‚ β”‚
β”‚ 483 β”‚ β”‚ ) β”‚
β”‚ 484 β”‚ if offload_state_dict is None and device_map is not None and "disk" in device_map.va β”‚
β”‚ 485 β”‚ β”‚ offload_state_dict = True β”‚
β”‚ ❱ 486 β”‚ load_checkpoint_in_model( β”‚
β”‚ 487 β”‚ β”‚ model, β”‚
β”‚ 488 β”‚ β”‚ checkpoint, β”‚
β”‚ 489 β”‚ β”‚ device_map=device_map, β”‚
β”‚ β”‚
β”‚ /usr/local/lib/python3.10/dist-packages/accelerate/utils/modeling.py:1116 in β”‚
β”‚ load_checkpoint_in_model β”‚
β”‚ β”‚
β”‚ 1113 β”‚ β”‚ β”‚ β”‚ β”‚ set_module_tensor_to_device(model, param_name, "meta") β”‚
β”‚ 1114 β”‚ β”‚ β”‚ β”‚ β”‚ offload_weight(param, param_name, state_dict_folder, index=state_dic β”‚
β”‚ 1115 β”‚ β”‚ β”‚ β”‚ else: β”‚
β”‚ ❱ 1116 β”‚ β”‚ β”‚ β”‚ β”‚ set_module_tensor_to_device(model, param_name, param_device, value=p β”‚
β”‚ 1117 β”‚ β”‚ β”‚
β”‚ 1118 β”‚ β”‚ # Force Python to clean up. β”‚
β”‚ 1119 β”‚ β”‚ del checkpoint β”‚
β”‚ β”‚
β”‚ /usr/local/lib/python3.10/dist-packages/accelerate/utils/modeling.py:142 in β”‚
β”‚ set_module_tensor_to_device β”‚
β”‚ β”‚
β”‚ 139 β”‚ if "." in tensor_name: β”‚
β”‚ 140 β”‚ β”‚ splits = tensor_name.split(".") β”‚
β”‚ 141 β”‚ β”‚ for split in splits[:-1]: β”‚
β”‚ ❱ 142 β”‚ β”‚ β”‚ new_module = getattr(module, split) β”‚
β”‚ 143 β”‚ β”‚ β”‚ if new_module is None: β”‚
β”‚ 144 β”‚ β”‚ β”‚ β”‚ raise ValueError(f"{module} has no attribute {split}.") β”‚
β”‚ 145 β”‚ β”‚ β”‚ module = new_module β”‚
β”‚ β”‚
β”‚ /usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py:1614 in getattr β”‚
β”‚ β”‚
β”‚ 1611 β”‚ β”‚ β”‚ modules = self.dict['_modules'] β”‚
β”‚ 1612 β”‚ β”‚ β”‚ if name in modules: β”‚
β”‚ 1613 β”‚ β”‚ β”‚ β”‚ return modules[name] β”‚
β”‚ ❱ 1614 β”‚ β”‚ raise AttributeError("'{}' object has no attribute '{}'".format( β”‚
β”‚ 1615 β”‚ β”‚ β”‚ type(self).name, name)) β”‚
β”‚ 1616 β”‚ β”‚
β”‚ 1617 β”‚ def setattr(self, name: str, value: Union[Tensor, 'Module']) -> None: β”‚
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'Attention' object has no attribute 'key'

It looks like library errors. Please help, thanks!

Same to me

any fix?

@williamberman could you check this quickly?

hey y'all sorry about that, if you install from diffusers main, this should be fixed :)

Sign up or log in to comment