Closed ha-lins closed 3 years ago
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 https://github.com/Shen-Lab/GraphCL/blob/4ca7742ea6a3411357c2e5da4dcfdbfab581d5f8/unsupervised_TU/gin.py#L71 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?
Yes, thanks for your response!
It works well now and the problem was from my incorrect modification.
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 getembeddings
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 ofdata_aug.x
was set to1
. So I removed this line and the bug was gone.What's your opinion about the issue and solution? Thanks in advance!