benfred / implicit

Fast Python Collaborative Filtering for Implicit Feedback Datasets
https://benfred.github.io/implicit/
MIT License
3.57k stars 612 forks source link

AttributeError: module 'implicit' has no attribute 'cpu' #589

Closed portkeys closed 2 years ago

portkeys commented 2 years ago

Hi @benfred I've been using implicit 0.4.8 for more than a year. With the update to 0.5.2, I'm having trouble to apply the ALS model to both my data and the lastfm data.

For example, below is an attempt trying to follow the tutorial in example folder:

Screen Shot 2022-07-06 at 3 33 25 PM

============================== If I remove the alpha, I got the error indicating no attribute 'cpu', which is also the same error we got in our production system. @benfred It'll be really appreciated if you could point me to the right direction. Thanks so much for all your work!

Screen Shot 2022-07-06 at 3 35 35 PM

================================= I even tried to import this way from implicit.cpu.als import AlternatingLeastSquares, and then it will return another error as TypeError: Can't instantiate abstract class AlternatingLeastSquares with abstract method rank_items

ita9naiwa commented 2 years ago

Hi. the alpha argument in ALS is updated in the main branch and it's not been released yet. ALS in 0.5.2 version does not contain alpha argument yet.

ita9naiwa commented 2 years ago

Hi. 0.6.0 version has released and did you check it... as I checked, it worked well in your case.

portkeys commented 2 years ago

Hi. 0.6.0 version has released and did you check it... as I checked, it worked well in your case.

Yes it works! Thanks so much!!!