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

Synchronize np.load(allow_pickle=True) with scipy.sparse.load_npz #14120

Closed
doumbouyarene opened this issue Jul 25, 2019 · 1 comment
Closed

Comments

@doumbouyarene
Copy link

Can't use scipy.sparse.load_npz since it's uses numpy.load which now requires allow_pickle to be explicitly set to True.

Reproducing code example:

import numpy as np
import scipy.sparse as sparse

user_indicator_features = sparse.load_npz(user_feat_file)

Error message:

bash-3.2$ python main.py --task predict
Using TensorFlow backend.
1564089376.935315

Traceback (most recent call last):
File "main.py", line 130, in
user_indicator_features = sparse.load_npz(user_feat_file)
File "/anaconda3/lib/python3.7/site-packages/scipy/sparse/_matrix_io.py", line 131, in load_npz
with np.load(file, **PICKLE_KWARGS) as loaded:
File "/Users/rdoumbouya/.local/lib/python3.7/site-packages/numpy/lib/npyio.py", line 451, in load
raise ValueError("Cannot load file containing pickled data "
ValueError: Cannot load file containing pickled data when allow_pickle=False

Numpy/Python version information:

Python 3.7.3
Numpy 1.16.4
Scipy 1.2.1

@pv
Copy link
Member

pv commented Jul 25, 2019 via email

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