Skip to content

img2img.py issue #17

@PlayBoxTech

Description

@PlayBoxTech

With current pushed code I get the following error:

  • This IS expected if you are initializing CLIPTextModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
  • This IS NOT expected if you are initializing CLIPTextModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
    loaded input image of size (720, 960) from /home/chris/Pictures/test/b.jpg
    scripts/img2img.py:53: DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
    image = image.resize((w, h), resample=PIL.Image.LANCZOS)
    Traceback (most recent call last):
    File "scripts/img2img.py", line 297, in
    main()
    File "scripts/img2img.py", line 239, in main
    init_latent = model.get_first_stage_encoding(model.encode_first_stage(init_image)) # move to latent space
    File "/home/chris/anaconda3/envs/dogg/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
    File "/home/chris/stable2/dogg/stable-diffusion/ldm/models/diffusion/ddpm.py", line 863, in encode_first_stage
    return self.first_stage_model.encode(x)
    File "/home/chris/stable2/dogg/stable-diffusion/ldm/models/autoencoder.py", line 325, in encode
    h = self.encoder(x)
    File "/home/chris/anaconda3/envs/dogg/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
    File "/home/chris/stable2/dogg/stable-diffusion/ldm/modules/diffusionmodules/model.py", line 492, in forward
    hs = [self.conv_in(x)]
    File "/home/chris/anaconda3/envs/dogg/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
    File "/home/chris/anaconda3/envs/dogg/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 447, in forward
    return self._conv_forward(input, self.weight, self.bias)
    File "/home/chris/anaconda3/envs/dogg/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 443, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
    RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same

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