Attentive-Group-Recommendation
Attentive-Group-Recommendation copied to clipboard
should I use pytorch 0.3.0 in GPU or CPU version? Or pytorch 1.0.1 can work out?
I seem to have a problem with the code. The error is "TypeError: torch.index_select received an invalid combination of arguments - got (torch.FloatTensor, int, !torch.IntTensor!), but expected (torch.FloatTensor source, int dim, torch.LongTensor index)". I wonder if I get the pytorch version wrong. Now I'm using the pytorch 0.3.0 and python 3.5.4.
I am sorry. It seems that you should use Pytorch 0.3.0 as framework. And the error you mentioned is that the pytorch version error, for some APIs, the input of version 1.0.1 is different from version 0.3.0.
And now I use the Pytorch 0.3.0, but still I have this error when I run the main.py.
Please add this line in main.py to check what's your runing enviroment version of pytorch.
print(torch.__version__)
If you comfire your pytorch version is 0.3.0, you can post your error log in this issue, and I am glad to help you solve your problem.
C:\Users\Khali\Anaconda2\envs\py3\envs\python35\python3_5.exe "D:/Python workspace/Attentive-Group-Recommendation-master/main.py"
torch_version: 0.3.0b0+591e73e
AGREE at embedding size 32, run Iteration:30, NDCG and HR at 5
Iteration 0, loss is [0.9978 ]
Iteration 0, loss is [0.9808 ]
Traceback (most recent call last):
File "D:/Python workspace/Attentive-Group-Recommendation-master/main.py", line 112, in
I am sorry, the error happened when the numpy data transfer to tensor data. It is because our the type of tensor is IntTensor type, however, the model need LongTensor type.
you can try the code below.
# util.py line 57
users_var = torch.from_numpy(users).type(torch.LongTensor)
Thanks a lot. It worked!