superlouis/GATGNN

Issue while running train.py file

Closed this issue · 2 comments

I am getting the following error while running the code :

Declaration: softmax(Tensor src, Tensor? index, Tensor? ptr=None, int? num_nodes=None) -> (Tensor)
Cast error details: Unable to cast Python instance of type <class 'int'> to C++ type 'at::Tensor'

Please help.

Whole Log :

Preparing dataset to use for Property Prediction. Please wait ...

Dataset for CGCNN---formation-energy ready !

TRAINING MODEL ...
Traceback (most recent call last):
File "train.py", line 112, in
predictions = net(data)
File "/home/kishalay/anaconda3/envs/messi/lib/python3.8/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/kishalay/GATGNN/gatgnn/model.py", line 214, in forward
x = self.node_atta_idx
File "/home/kishalay/anaconda3/envs/messi/lib/python3.8/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/kishalay/GATGNN/gatgnn/model.py", line 145, in forward
return self.propagate(edge_index, x=x,edge_attr=edge_attr)
File "/home/kishalay/anaconda3/envs/messi/lib/python3.8/site-packages/torch_geometric/nn/conv/message_passing.py", line 237, in propagate
out = self.message(**msg_kwargs)
File "/home/kishalay/GATGNN/gatgnn/model.py", line 158, in message
alpha = softmax(alpha, edge_index_i, size_i)
RuntimeError: softmax() Expected a value of type 'Optional[Tensor]' for argument 'ptr' but instead found type 'int'.
Position: 2
Value: 6814
Declaration: softmax(Tensor src, Tensor? index, Tensor? ptr=None, int? num_nodes=None) -> (Tensor)
Cast error details: Unable to cast Python instance of type <class 'int'> to C++ type 'at::Tensor'

Fixed in v0.2.