SimGRACE icon indicating copy to clipboard operation
SimGRACE copied to clipboard

Semi-supervised learning error

Open lixiangucas01 opened this issue 3 years ago • 0 comments

running semi-supervised learning code on NCI1 dataset occurs following errors: Traceback (most recent call last): File "main.py", line 318, in run_exp_benchmark() File "main.py", line 265, in run_exp_benchmark dd_odeg10_ak1=True)) File "main.py", line 184, in run_exp_lib dataset_name=args.dataset, suffix=args.suffix) File "/home/work/SimGRACE/semisupervised_TU/pre-training/train_eval.py", line 117, in cross_validation_with_val_set model, vice_model, optimizer, dataset, device, batch_size, aug1, aug_ratio1, aug2, aug_ratio2, args) File "/home/work/SimGRACE/semisupervised_TU/pre-training/train_eval.py", line 245, in train out2 = gen_ran_output(data1, model, vice_model, args) File "/home/work/SimGRACE/semisupervised_TU/pre-training/train_eval.py", line 231, in gen_ran_output z2 = vice_model.forward_cl(data) File "/home/work/SimGRACE/semisupervised_TU/pre-training/res_gcn.py", line 173, in forward_cl return self.forward_BNConvReLU_cl(x, edge_index, batch, xg) File "/home/work/SimGRACE/semisupervised_TU/pre-training/res_gcn.py", line 180, in forward_BNConvReLU_cl x_ = F.relu(conv(x_, edge_index)) File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/home/work/SimGRACE/semisupervised_TU/pre-training/gcn_conv.py", line 106, in forward edge_index, x.size(0), edge_weight, self.improved, x.dtype) File "/home/work/SimGRACE/semisupervised_TU/pre-training/gcn_conv.py", line 91, in norm deg = scatter_add(edge_weight, row, dim=0, dim_size=num_nodes) RuntimeError: The following operation failed in the TorchScript interpreter. Traceback of TorchScript (most recent call last): File "/opt/conda/lib/python3.7/site-packages/torch_scatter/scatter.py", line 31, in scatter_add out: Optional[torch.Tensor] = None, dim_size: Optional[int] = None) -> torch.Tensor: return scatter_sum(src, index, dim, out, dim_size) ~~~~~~~~~~~ <--- HERE File "/opt/conda/lib/python3.7/site-packages/torch_scatter/scatter.py", line 12, in scatter_sum out: Optional[torch.Tensor] = None, dim_size: Optional[int] = None) -> torch.Tensor: index = broadcast(index, src, dim) ~~~~~~~~~ <--- HERE if out is None: size = list(src.size()) File "/opt/conda/lib/python3.7/site-packages/torch_scatter/utils.py", line 13, in broadcast for _ in range(src.dim(), other.dim()): src = src.unsqueeze(-1) src = src.expand_as(other) ~~~~~~~~~~~~~ <--- HERE return src RuntimeError: expand(torch.cuda.LongTensor{[2, 12738]}, size=[12738]): the number of sizes provided (1) must be greater or equal to the number of dimensions in the tensor (2)

lixiangucas01 avatar Sep 14 '22 08:09 lixiangucas01