Skip to content

TensorRT Example TypeError #3181

@djj0s3

Description

@djj0s3

Describe the bug

Running the example in the repo for TensorRT receiving this error:

 File "/root/.cache/huggingface/modules/diffusers_modules/git/stable_diffusion_tensorrt_txt2img.py", line 706, in to
    super().to(torch_device, silence_dtype_warnings)
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/diffusers/pipelines/pipeline_utils.py", line 643, in to
    module.to(torch_device, torch_dtype)
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1126, in to
    device, dtype, non_blocking, convert_to_format = torch._C._nn._parse_to(*args, **kwargs)
TypeError: to() received an invalid combination of arguments - got (str, bool), but expected one of:
 * (torch.device device, torch.dtype dtype, bool non_blocking, bool copy, *, torch.memory_format memory_format)
 * (torch.dtype dtype, bool non_blocking, bool copy, *, torch.memory_format memory_format)
 * (Tensor tensor, bool non_blocking, bool copy, *, torch.memory_format memory_format)

Reproduction

Run the example in the repo for TensorRT: https://github.com/huggingface/diffusers/blob/main/examples/community/README.md#tensorrt-text2image-stable-diffusion-pipeline

Logs

No response

System Info

cuda: "11.7"
python_version: "3.9.16"
system_packages:
- "python3-pip"
python_packages:
- "diffusers==0.15.1"
- "torch==2.0.0"
- "ftfy==6.1.1"
- "scipy==1.9.3"
- "transformers==4.25.1"
- "accelerate==0.15.0"
- "huggingface-hub==0.13.2"
- "nvidia-pyindex==1.0.9"
- "tensorrt==8.6.0"

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