Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: cannot set WRITEABLE flag to True of this array #337

Open
MMCMA opened this issue Jul 25, 2023 · 2 comments
Open

ValueError: cannot set WRITEABLE flag to True of this array #337

MMCMA opened this issue Jul 25, 2023 · 2 comments

Comments

@MMCMA
Copy link

MMCMA commented Jul 25, 2023

After installing sciki-sparse I get the following error when fitting a LinearGAM with pygam. Here is the relevant error trace:

  File "/opt/conda/envs/py310/lib/python3.10/site-packages/pygam/pygam.py", line 915, in fit
    self._pirls(X, y, weights)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/pygam/pygam.py", line 753, in _pirls
    E = self._cholesky(S + P, sparse=False, verbose=self.verbose)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/pygam/pygam.py", line 520, in _cholesky
    L = cholesky(A, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/pygam/utils.py", line 59, in cholesky
    P[np.arange(len(p)), p] = 1
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/scipy/sparse/_lil.py", line 331, in __setitem__
    IndexMixin.__setitem__(self, key, x)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/scipy/sparse/_index.py", line 118, in __setitem__
    i, j = _broadcast_arrays(row, col)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/scipy/sparse/_index.py", line 24, in _broadcast_arrays
    y.flags.writeable = b.flags.writeable
ValueError: cannot set WRITEABLE flag to True of this array

I use the following versions:
pygam : 0.9.0

@chenyangkang
Copy link

I got the same issue

@chenyangkang
Copy link

conda uninstall scikit-sparse works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants