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

Getting error: "Error occurred when executing PhotoMakerAdapter_Loader_local: Error(s) in loading state_dict for PhotoMakerIDEncoder: Missing key(s) in state_dict: "vision_model.embeddings.position_ids"." #53

Open
sweetramen opened this issue Jan 23, 2024 · 1 comment

Comments

@sweetramen
Copy link

Not sure why, I have tried all the fixes recommended on this page, including upgrading transformers etc. I have enough memory free, so don't think that is the issue either.

Error occurred when executing PhotoMakerAdapter_Loader_local:

Error(s) in loading state_dict for PhotoMakerIDEncoder:
Missing key(s) in state_dict: "vision_model.embeddings.position_ids".

File "J:\Software\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 154, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "J:\Software\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 84, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "J:\Software\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 77, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "J:\Software\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-PhotoMakerv2\PhotoMakerNode.py", line 151, in load_photomaker_adapter
pipe.load_photomaker_adapter(
File "J:\Software\AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\huggingface_hub\utils_validators.py", line 118, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "J:\Software\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-PhotoMakerv2\pipeline.py", line 114, in load_photomaker_adapter
id_encoder.load_state_dict(state_dict["id_encoder"], strict=True)
File "J:\Software\AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 2152, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(

@h3clikejava
Copy link

How to fix it?

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

2 participants