PhotoMaker
PhotoMaker copied to clipboard
Missing key(s) in state_dict: "vision_model.embeddings.position_ids".
update transfomers to the newest
【自动恢复】来信已收到,我将尽快回复你!
update transfomers to the newest
How to do this?
pip install -U transformers
pip install -U transformers It works, thx my bro
I tried this, but I still get the error:
Error(s) in loading state_dict for PhotoMakerIDEncoder: Missing key(s) in state_dict: "vision_model.embeddings.position_ids".
Could it be something else?
Here is the full error:
got prompt Loading PhotoMaker components [1] id_encoder from [J:\Software\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-PhotoMaker]... ERROR:root:!!! Exception during processing !!! ERROR:root:Traceback (most recent call last): 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( RuntimeError: Error(s) in loading state_dict for PhotoMakerIDEncoder: Missing key(s) in state_dict: "vision_model.embeddings.position_ids".
I can confirm pip install -U transformers
fixed this issue for me. Had v4.24 running before.
@sweetramen whats your transformers version?
$ pip show transformers
Name: transformers
Version: 4.37.2