Junsu-Cho / ProxySR

ProxySR (Unsupervised Proxy Selection for Session-based Recommender Systems, SIGIR'21)
13 stars 3 forks source link

Software environment #3

Open Kumius opened 3 years ago

Kumius commented 3 years ago

Hi! I failed to run this model due to syntax errors (e.g. line 79 in main.py). Even though I have fixed these errors, the training still broke.

Do you know how to fix this?


Downloads/ProxySR-main/main.py:213: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requiresgrad(True), rather than torch.tensor(sourceTensor). target = torch.tensor(valid).to(torch.long).to(device) Traceback (most recent call last): File "Downloads/ProxySR-main/main.py", line 239, in main() File "Downloads/ProxySR-main/main.py", line 88, in main recalls, mrrs = validate(val_data, model, K, tau) File "Downloads/ProxySR-main/main.py", line 214, in validate distance = model(sess, length, tau, valid, train=False) File "Downloads/ProxySR-main/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, **kwargs) File "Downloads/ProxySR-main/model.py", line 127, in forward return self.test_phase(batch_size, isValidSession, p_s, s_s_proj[:, -1, :], I_emb, v) File "Downloads/ProxySR-main/model.py", line 151, in test_phase if not isValidSession[i]: continue RuntimeError: CUDA error: an illegal instruction was encountered CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

Junsu-Cho commented 3 years ago

Hi, thank you for your interest in my work.

I am afraid your environment is Python 3.

These codes are implemented in Python 2, so you should modify some parts of the codes if you want to run this codes in Python 3. When I tested in Python 3, I can run the codes without any error after modifying 1) print, 2) zip, and 3) data type (casting float to int when needed).

Also, my PyTorch version is 1.0.1 (also, no error in 1.3.1), and CUDA version is 11.0. I don't know how to fix the bug, but I found some search results that say the "illegal instruction" error occurs because of PyTorch/CUDA version.

I wish my answer could be of help. Junsu Cho

Kumius commented 3 years ago

Thanks for your help! I ran your code in Python 3, and used the latest PyTorchand CUDA. I think you are right and I will try the version you have recommended.

Yuming Hu