Skip to content

Quantum classical hybrid model cannot load parameters from dictionary #210

@zeng1in

Description

@zeng1in

When my model is quantum classical hybrid model, I can use
I use

torch.save(model.state_dict(), "model_dict.pt")
model2 = QFCModel()
model2.load_state_dict(torch.load("model_dict.pt"))

RuntimeError: Error (s) in loading state_ Dict for QFCModel:
Unexpected key (s) in state_ Dict: "linear. weight", "linear. bias"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions