Skip to content

inference_IMAGdressing_controlnetinpainting.py Error in Google Colab #16

@devinross

Description

@devinross

Thank you for publishing this repo...
Running this project in the Google Colab environment with a GPU. I've successfully ran inference_IMAGdressing.py, but inference_IMAGdressing_controlnetinpainting.py is another story.

!python inference_IMAGdressing_controlnetinpainting.py --cloth_path ../tee.jpg --model_path ../person.png --model_ckpt ../drive/MyDrive/IMAGDressing-v1_512.pt

Yields the following error:

RuntimeError: Device type CUDA is not supported for torch.Generator() api.

/usr/local/lib/python3.10/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
/usr/local/lib/python3.10/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
Traceback (most recent call last):
  File "/content/IMAGDressing/inference_IMAGdressing_controlnetinpainting.py", line 179, in <module>
    pipe, generator = prepare(args)
  File "/content/IMAGDressing/inference_IMAGdressing_controlnetinpainting.py", line 63, in prepare
    generator = torch.Generator(device=args.device).manual_seed(42)
RuntimeError: Device type CUDA is not supported for torch.Generator() api.

Any idea on how to fix this?

Outside of installing the requirements, I've had to also install

!pip install torchvision
!pip install onnxruntime
!pip install opencv-python
!pip install matplotlib
!pip install scipy
!pip install scikit-image
!conda install pytorch torchvision cudatoolkit=11.8 -c pytorch

It would be helpful if this was included in the README.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions