LAION-AI / LAION-AI/CLAP

**"Inconsistent checkpoint loading behavior between local machine and GPU cluster"**

Open
#151 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.3k
Forks
213
PR merge metrics
No merged PRs in 30d

Description

Description

I am encountering a RuntimeError when trying to load a checkpoint using the CLAP model on a GPU cluster. The error message indicates that there are unexpected key(s) in the state_dict.

Error Message

RuntimeError: Error(s) in loading state_dict for CLAP:
Unexpected key(s) in state_dict: "text_branch.embeddings.position_ids".

Steps to Reproduce
  1. Install laion-clap using pip.
  2. Attempt to load the checkpoint using the following code:
import torch
import laion_clap

# Load the CLAP model
model = laion_clap.CLAP_Module(enable_fusion=False)
model.load_ckpt()

Additional Information:

The code works fine on my local machine, but fails on the GPU cluster.

Python version: 3.10.8

What I Have Tried:

Verified that all dependencies are correctly installed.
Attempted to filter the state_dict to remove unexpected keys, but encountered further issues.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the issue's Python snippet at model.load_ckpt(), then compare the local and GPU-cluster environments and checkpoint-loading behavior. Done means the same checkpoint loads successfully in both environments without the unexpected text_branch.embeddings.position_ids key error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.