google / lightweight_mmm

LightweightMMM 🦇 is a lightweight Bayesian Marketing Mix Modeling (MMM) library that allows users to easily train MMMs and obtain channel attribution information.
https://lightweight-mmm.readthedocs.io/en/latest/index.html
Apache License 2.0
881 stars 187 forks source link

INVALID_ARGUMENT: Python buffer protocol is only defined for CPU buffers. #204

Open nandakishorem777 opened 1 year ago

nandakishorem777 commented 1 year ago

Having this issue while running plot.plot_fit_model() plot.plot_out_of_sample_model_fit()

These both functions are calculating _r2score from _arviz.r2score which is calculating from numba. At some point numba is trying to access memoryview(predictions) which is throwing the error.

predictions type is DeviceArray and the memoryview fails at this point. How do we avoid this?

uomodellamansarda commented 1 year ago

I didn't get this issue running on colab the library, but let's investigate better the issue.

What versions are you working on? I didn't investigated deeply but these are the versions you should use:

And there is this compatibility issue explained here (maybe is not related): downgrade numpy requirement temporarily, until numba compatibility wi