Traceback (most recent call last): File "training.py", line 96, in <module> train(model, device, train_loader, optimizer, epoch+1) File "training.py", line 28, in train output = model(data) File "/home/qcui/anaconda3/envs/geometric/lib/python3.8/site-packages/torch/nn/modules/module.py", line 532, in __call__ result = self.forward(*input, **kwargs) File "/data/qcui/DTA/GraphDTA/ecfp_maccs_graph/CPI_prediction/models/gcn.py", line 64, in forward x = gmp(x, batch) # global max pooling File "/home/qcui/anaconda3/envs/geometric/lib/python3.8/site-packages/torch_geometric/nn/glob/glob.py", line 76, in global_max_pool return scatter(x, batch, dim=0, dim_size=size, reduce='max') File "/home/qcui/anaconda3/envs/geometric/lib/python3.8/site-packages/torch_scatter/scatter.py", line 155, in scatter return scatter_max(src, index, dim, out, dim_size)[0] RuntimeError: expected scalar type Long but found Float The above operation failed in interpreter. Traceback (most recent call last): File "/home/qcui/anaconda3/envs/geometric/lib/python3.8/site-packages/torch_scatter/scatter.py", line 69 dim_size: Optional[int] = None ) -> Tuple[torch.Tensor, torch.Tensor]: return torch.ops.torch_scatter.scatter_max(src, index, dim, out, dim_size) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
时间: 2023-05-13 07:07:16 浏览: 714
Mac下anaconda中Spyder打开报错Traceback(most recent call last)…问题
5星 · 资源好评率100%
这是一个Python的错误追踪信息,其中包含了程序在运行时出现的错误信息。根据错误信息可以看出,在文件"training.py"的第96行调用了一个名为"train"的函数,并传入了一些参数。在"train"函数中,又调用了一个名为"model"的函数,并传入了一个名为"data"的参数。在"model"函数中,又调用了一个名为"gmp"的函数,并传入了两个参数"x"和"batch"。但是,程序在执行"gmp"函数时出现了错误,具体错误信息需要查看"gmp"函数的代码才能确定。
阅读全文