TencentARC / PhotoMaker

PhotoMaker [CVPR 2024]
https://photo-maker.github.io/
Other
9.39k stars 749 forks source link

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"." #96

Open sweetramen opened 8 months ago

sweetramen commented 8 months ago

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. I am running the Zho Zho Zho version.

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(

Paper99 commented 8 months ago

Upgrade to the latest transformers

Paper99 commented 8 months ago

See #41 for more details about running the PhotoMaker on Windows