Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while starting models_server.py #28

Closed
Rikiar73574 opened this issue Apr 4, 2023 · 3 comments
Closed

Error while starting models_server.py #28

Rikiar73574 opened this issue Apr 4, 2023 · 3 comments

Comments

@Rikiar73574
Copy link

Hi,
attempting to install this on windows, had a few issues with installing pytorch at the start but after that i got this:

Traceback (most recent call last):
  File "C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\models\modeling_utils.py", line 98, in load_state_dict
    return safetensors.torch.load_file(checkpoint_file, device="cpu")
  File "C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\site-packages\safetensors\torch.py", line 100, in load_file
    result[k] = f.get_tensor(k)
RuntimeError: shape '[640, 2560]' is invalid for input of size 798399

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\models\modeling_utils.py", line 102, in load_state_dict
    if f.read().startswith("version"):
  File "C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 40678: character maps to <undefined>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\AI\JARVIS\server\models_server.py", line 338, in <module>
    pipes = load_pipes(local_deployment)
  File "D:\AI\JARVIS\server\models_server.py", line 315, in load_pipes
    "control": ControlNetModel.from_pretrained(f"{local_fold}/lllyasviel/sd-controlnet-mlsd", torch_dtype=torch.float16),
  File "C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\models\modeling_utils.py", line 557, in from_pretrained
    state_dict = load_state_dict(model_file, variant=variant)
  File "C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\models\modeling_utils.py", line 114, in load_state_dict
    raise OSError(
OSError: Unable to load weights from checkpoint file for 'models/lllyasviel/sd-controlnet-mlsd\diffusion_pytorch_model.safetensors' at 'models/lllyasviel/sd-controlnet-mlsd\diffusion_pytorch_model.safetensors'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

any ideas?

@ErikDombi
Copy link
Contributor

Minimum requirements says that Ubuntu 16.04 LTS is required

@gillmohnish
Copy link

If you are trying to load a PyTorch model from a TensorFlow checkpoint, set the 'from_tf' argument to 'True' while loading the model.

@1hachem
Copy link

1hachem commented Apr 5, 2023

I think that the problem is with the path, in unix we use the forward slash / while in windows it's \, the path you causing the error contains both !
try to use wsl this could solve your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants