admin管理员组

文章数量:1123504

I have trained an ALS model using the implicit package with GPU support. However, when evaluating the model using the ndcg_at_k function, I encountered the following error:

from implicit.evaluation import ndcg_at_k, mean_average_precision_at_k

ndcg = ndcg_at_k(model, train_user_items, test_user_items, K=14, show_progress=True, num_threads=1)
AttributeError: 'implicit.evaluation._memoryviewslice' object has no attribute 'dtype'

Environment Details:

  • implicit: 0.7.2 (built from source)
  • Python: 3.11.2
  • CUDA: 12.3
  • OS: Debian GNU/Linux 12

Attempted Solutions:

  1. I tried converting the model to CPU, but it didn't resolve the issue.

Question: How can I resolve this AttributeError when evaluating the model with the implicit library?

本文标签: pythonAttributeError 39implicitevaluationmemoryviewslice39 object has no attribute 39dtype39Stack Overflow