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

Bugs report for unsupervised_TU #8

Closed
ha-lins opened this issue Dec 29, 2020 · 2 comments
Closed

Bugs report for unsupervised_TU #8

ha-lins opened this issue Dec 29, 2020 · 2 comments

Comments

@ha-lins
Copy link

ha-lins commented Dec 29, 2020

Hi @yyou1996,

When I ran the unsupervised experiments for Biochemical Molecules datasets, I met the bug of size mismatch as follows:

python gsimclr.py --DS MUTAG --lr 0.01 --local --num-gc-layers 3 --aug dnodes --seed 0
188
7

lr: 0.01
num_features: 7
hidden_dim: 32
num_gc_layers: 3

Traceback (most recent call last):
File "gsimclr.py", line 190, in
emb, y = model.encoder.get_embeddings(dataloader_eval)
File "/data3/linshuai/GraphCL/unsupervised_TU/gin.py", line 87, in get_embeddings
x, _ = self.forward(x, edge_index, batch)
File "/data3/linshuai/GraphCL/unsupervised_TU/gin.py", line 61, in forward
x = F.relu(self.convs[i](x, edge_index))
File "/data/linshuai/anaconda3/envs/mvgrl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/data/linshuai/anaconda3/envs/mvgrl/lib/python3.6/site-packages/torch_geometric/nn/conv/gin_conv.py", line 69, in forward
return self.nn(out)
File "/data/linshuai/anaconda3/envs/mvgrl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/data/linshuai/anaconda3/envs/mvgrl/lib/python3.6/site-packages/torch/nn/modules/container.py", line 100, in forward
input = module(input)
File "/data/linshuai/anaconda3/envs/mvgrl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/data/linshuai/anaconda3/envs/mvgrl/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 87, in forward
return F.linear(input, self.weight, self.bias)
File "/data/linshuai/anaconda3/envs/mvgrl/lib/python3.6/site-packages/torch/nn/functional.py", line 1370, in linear
ret = torch.addmm(bias, input, weight.t())
RuntimeError: size mismatch, m1: [2258 x 1], m2: [7 x 32] at /pytorch/aten/src/THC/generic/THCTensorMathBlas.cu:290

It seems that the aug is 'none' here in the testing and thus the second dim of data_aug.x was set to 1. So I removed this line and the bug was gone.

What's your opinion about the issue and solution? Thanks in advance!

@yyou1996
Copy link
Collaborator

Hi @ha-lins,

Thanks for your question. In evaluation data_aug should not be called since get_embeddings function only operate on data of the returned data, data_aug from data_loader (see

data = data[0]
in get_embeddings function), thus the operation in https://github.com/Shen-Lab/GraphCL/blob/master/unsupervised_TU/aug.py#L247 should not affect. Did you check the operated object in get_embeddings function?

@ha-lins
Copy link
Author

ha-lins commented Dec 30, 2020

Yes, thanks for your response!

It works well now and the problem was from my incorrect modification.

@ha-lins ha-lins closed this as completed Dec 30, 2020
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

2 participants