Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use_Case_1.py" in GPU mode #20

Open
rahvis opened this issue Aug 29, 2023 · 2 comments
Open

Use_Case_1.py" in GPU mode #20

rahvis opened this issue Aug 29, 2023 · 2 comments

Comments

@rahvis
Copy link

rahvis commented Aug 29, 2023

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.

@sujay-pandit
Copy link

Facing the same issue.

@alhussain-shaikh
Copy link

@rahvis hi, I am getting the error for use_case_2:
image
can you tell me how you run use_case_2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants