Skip to content

TypeError: couldn't find storage object Float8_e4m3fnStorage #9298

@maxin9966

Description

@maxin9966

System Info

Name: torch
Version: 2.4.0+cu124 OR Version: 2.3.1

Name: transformers
Version: 4.44.2

CUDA Version: 12.5

Error:

Traceback (most recent call last):
File "/home/ma/work/flux/demo/TotoroUI/flux-demo-hyper.py", line 552, in gen
img_path, image = gen_with_api(prompt, steps, guidance, width, height, seed)
File "/home/ma/work/flux/demo/TotoroUI/flux-demo-hyper.py", line 392, in gen_with_api
return generate2(prompt, steps, guidance, width, height, seed)
File "/home/ma/work/flux/demo/TotoroUI/flux-demo-hyper.py", line 513, in generate2
flux_pipe = FluxPipeline.from_pretrained(bfl_repo, transformer=transformer, torch_dtype=torch.float8_e4m3fn)
File "/home/ma/miniconda3/envs/flux/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/home/ma/miniconda3/envs/flux/lib/python3.10/site-packages/diffusers/pipelines/pipeline_utils.py", line 859, in from_pretrained
loaded_sub_model = load_sub_model(
File "/home/ma/miniconda3/envs/flux/lib/python3.10/site-packages/diffusers/pipelines/pipeline_loading_utils.py", line 698, in load_sub_model
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "/home/ma/miniconda3/envs/flux/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3794, in from_pretrained
dtype_orig = cls._set_default_torch_dtype(torch_dtype)
File "/home/ma/miniconda3/envs/flux/lib/python3.10/site-packages/transformers/modeling_utils.py", line 1608, in _set_default_torch_dtype
torch.set_default_dtype(dtype)
File "/home/ma/miniconda3/envs/flux/lib/python3.10/site-packages/torch/init.py", line 1009, in set_default_dtype
_C._set_default_dtype(d)
TypeError: couldn't find storage object Float8_e4m3fnStorage

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

1

Expected behavior

1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleIssues that haven't received updates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions