-
Notifications
You must be signed in to change notification settings - Fork 30
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
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1) #6
Comments
you can add one more dimension to 'input', try input = torch.unsqueeze(input, 0). |
I try chage batch_loss = loss_fn(batch_output, label[batch_edges]) to |
Traceback (most recent call last):
File "D:/PyCharm/Py_project/E-ResGAT-master/fit_model.py", line 189, in
File "D:/PyCharm/Py_project/E-ResGAT-master/fit_model.py", line 114, in fit
acc_val, loss_val, val_output = predict_(alg, model, label, loss_fn, val)
File "D:/PyCharm/Py_project/E-ResGAT-master/fit_model.py", line 145, in predict_
batch_loss = loss_fn(batch_output, label[batch_edges])
File "D:\Anaconda\envs\GraphSAGE\lib\site-packages\torch\nn\modules\module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "D:\Anaconda\envs\GraphSAGE\lib\site-packages\torch\nn\modules\loss.py", line 948, in forward
ignore_index=self.ignore_index, reduction=self.reduction)
File "D:\Anaconda\envs\GraphSAGE\lib\site-packages\torch\nn\functional.py", line 2422, in cross_entropy
return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
File "D:\Anaconda\envs\GraphSAGE\lib\site-packages\torch\nn\functional.py", line 1591, in log_softmax
ret = input.log_softmax(dim)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
Hello, can you help me solve this problem?
The text was updated successfully, but these errors were encountered: