Skip to content

Use_Case_1.py" in GPU mode  #20

@rahvis

Description

@rahvis

Use_Case_1.py" in GPU mode throws the same error as when ran with only CPU.

!python use_case_1.py

Traceback (most recent call last):
  File "/content/hw2vec/examples/use_case_1.py", line 33, in <module>
    graph_emb = use_case_1(cfg, hw_design_dir_path,\
  File "/content/hw2vec/examples/use_case_1.py", line 18, in use_case_1
    model.load_model(pretrained_model_cfg_path, pretrained_model_weight_path)
  File "/content/hw2vec/hw2vec/graph2vec/models.py", line 105, in load_model
    self.load_state_dict(torch.load(model_weight_path, map_location=torch.device('cpu')))
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 2041, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for GRAPH2VEC:
	Missing key(s) in state_dict: "layers.0.graph_conv.lin.weight", "layers.1.graph_conv.lin.weight", "pool1.graph_pool.gnn.lin_rel.weight", "pool1.graph_pool.gnn.lin_rel.bias", "pool1.graph_pool.gnn.lin_root.weight". 
	Unexpected key(s) in state_dict: "layers.0.graph_conv.weight", "layers.1.graph_conv.weight", "pool1.graph_pool.gnn.lin_l.weight", "pool1.graph_pool.gnn.lin_l.bias", "pool1.graph_pool.gnn.lin_r.weight". 

Can you please help with this issue?

use_case_2.py and use_case_3.py works fine as documented on the GitHub page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions