cure-lab / MagicDrive

[ICLR24] Official implementation of the paper “MagicDrive: Street View Generation with Diverse 3D Geometry Control”
https://gaoruiyuan.com/magicdrive/
GNU Affero General Public License v3.0
664 stars 40 forks source link

AttributeError: 'BasicTransformerBlock' object has no attribute '_args' #113

Closed CSUXA closed 1 day ago

CSUXA commented 2 days ago

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /root/autodl-tmp/MagicDrive/demo/interactive_gui.py:122 in │ │ │ │ 119 │ for sample in glob.glob(args.data): │ │ 120 │ │ data_ids.append(os.path.basename(sample).split(".")[0]) │ │ 121 │ │ │ ❱ 122 │ cfg, pipe = load_model_from(args.model, with_xformers=args.xformers) │ │ 123 │ # image = run_pipe(cfg, pipe, data, seed) │ │ 124 │ runner = partial(run_pipe, cfg=cfg, pipe=pipe) │ │ 125 │ │ │ │ /root/autodl-tmp/MagicDrive/demo/interactive_gui.py:40 in load_model_from │ │ │ │ 37 │ if hasattr(cfg.model, "unet_module"): │ │ 38 │ │ unet_cls = load_module(cfg.model.unet_module) │ │ 39 │ │ unet_path = os.path.join(dir, cfg.model.unet_dir) │ │ ❱ 40 │ │ unet = unet_cls.from_pretrained( │ │ 41 │ │ │ unet_path, torch_dtype=weight_dtype) │ │ 42 │ │ unet.eval() │ │ 43 │ │ pipe_param["unet"] = unet │ │ │ │ /root/autodl-tmp/MagicDrive/third_party/diffusers/src/diffusers/models/modeling_utils.py:597 in │ │ from_pretrained │ │ │ │ 594 │ │ │ if low_cpu_mem_usage: │ │ 595 │ │ │ │ # Instantiate model with empty weights │ │ 596 │ │ │ │ with accelerate.init_empty_weights(): │ │ ❱ 597 │ │ │ │ │ model = cls.from_config(config, unused_kwargs) │ │ 598 │ │ │ │ │ │ 599 │ │ │ │ # if device_map is None, load the state dict and move the params from me │ │ 600 │ │ │ │ if device_map is None: │ │ │ │ /root/autodl-tmp/MagicDrive/third_party/diffusers/src/diffusers/configuration_utils.py:234 in │ │ from_config │ │ │ │ 231 │ │ │ │ init_dict[deprecated_kwarg] = unused_kwargs.pop(deprecated_kwarg) │ │ 232 │ │ │ │ 233 │ │ # Return model and optionally state and/or unused_kwargs │ │ ❱ 234 │ │ model = cls(init_dict) │ │ 235 │ │ │ │ 236 │ │ # make sure to also save config parameters that might be used for compatible cla │ │ 237 │ │ model.register_to_config(hidden_dict) │ │ │ │ /root/autodl-tmp/MagicDrive/third_party/diffusers/src/diffusers/configuration_utils.py:613 in │ │ inner_init │ │ │ │ 610 │ │ ) │ │ 611 │ │ new_kwargs = {config_init_kwargs, new_kwargs} │ │ 612 │ │ getattr(self, "register_to_config")(new_kwargs) │ │ ❱ 613 │ │ init(self, *args, init_kwargs) │ │ 614 │ │ │ 615 │ return inner_init │ │ 616 │ │ │ │ /root/autodl-tmp/MagicDrive/./magicdrive/networks/unet_2d_condition_multiview.py:226 in init │ │ │ │ 223 │ │ │ if isinstance(mod, BasicTransformerBlock): │ │ 224 │ │ │ │ if crossview_attn_type == "basic": │ │ 225 │ │ │ │ │ _set_module(self, name, BasicMultiviewTransformerBlock( │ │ ❱ 226 │ │ │ │ │ │ mod._args, │ │ 227 │ │ │ │ │ │ neighboring_view_pair=neighboring_view_pair, │ │ 228 │ │ │ │ │ │ neighboring_attn_type=neighboring_attn_type, │ │ 229 │ │ │ │ │ │ zero_module_type=zero_module_type, │ │ │ │ /root/miniconda3/envs/MagicDrive-main/lib/python3.8/site-packages/torch/nn/modules/module.py:117 │ │ 7 in getattr │ │ │ │ 1174 │ │ │ modules = self.dict['_modules'] │ │ 1175 │ │ │ if name in modules: │ │ 1176 │ │ │ │ return modules[name] │ │ ❱ 1177 │ │ raise AttributeError("'{}' object has no attribute '{}'".format( │ │ 1178 │ │ │ type(self).name, name)) │ │ 1179 │ │ │ 1180 │ def setattr(self, name: str, value: Union[Tensor, 'Module']) -> None: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ AttributeError: 'BasicTransformerBlock' object has no attribute '_args'

flymin commented 1 day ago

Duplicate with #7