Cannot be load

#3
by lea97338 - opened

This model cannot be load by diffuser
Error: ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/tmp/ipykernel_2411/889369546.py in <cell line: 0>()
3
4 # switch to "mps" for apple devices
----> 5 pipe = DiffusionPipeline.from_pretrained("microsoft/Lens", dtype=torch.bfloat16, device_map="cuda")
6
7 prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"

5 frames/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
86 kwargs = smoothly_deprecate_legacy_arguments(fn_name=fn.name, kwargs=kwargs)
87
---> 88 return fn(*args, **kwargs)
89
90 return _inner_fn # type: ignore

/usr/local/lib/python3.12/dist-packages/diffusers/pipelines/pipeline_utils.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
857 " is neither a valid local path nor a valid repo id. Please check the parameter."
858 )
--> 859 cached_folder = cls.download(
860 pretrained_model_name_or_path,
861 cache_dir=cache_dir,

/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
86 kwargs = smoothly_deprecate_legacy_arguments(fn_name=fn.name, kwargs=kwargs)
87
---> 88 return fn(*args, **kwargs)
89
90 return _inner_fn # type: ignore

/usr/local/lib/python3.12/dist-packages/diffusers/pipelines/pipeline_utils.py in download(cls, pretrained_model_name, **kwargs)
1691
1692 # retrieve passed components that should not be downloaded
-> 1693 pipeline_class = _get_pipeline_class(
1694 cls,
1695 config_dict,

/usr/local/lib/python3.12/dist-packages/diffusers/pipelines/pipeline_loading_utils.py in _get_pipeline_class(class_obj, config, load_connected_pipeline, custom_pipeline, repo_id, hub_revision, class_name, cache_dir, revision, trust_remote_code)
524 class_name = class_name[4:] if class_name.startswith("Flax") else class_name
525
--> 526 pipeline_cls = getattr(diffusers_module, class_name)
527
528 if load_connected_pipeline:

/usr/local/lib/python3.12/dist-packages/diffusers/utils/import_utils.py in getattr(self, name)
1006 value = getattr(module, name)
1007 else:
-> 1008 raise AttributeError(f"module {self.name} has no attribute {name}")
1009
1010 setattr(self, name, value)

AttributeError: module diffusers has no attribute LensPipeline
All code:
import torch
from diffusers import DiffusionPipeline

switch to "mps" for apple devices

pipe = DiffusionPipeline.from_pretrained("microsoft/Lens", dtype=torch.bfloat16, device_map="cuda")

prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]

Sign up or log in to comment