AthenaEPI / dmipy

The open source toolbox for reproducible diffusion MRI-based microstructure estimation
MIT License
96 stars 30 forks source link

there is error when loading SD2BinghamDistributed #58

Closed foxet closed 5 years ago

foxet commented 5 years ago

from dmipy.distributions.distribute_models import SD2BinghamDistributed


ValueError Traceback (most recent call last)

in ----> 1 from dmipy.distributions.distribute_models import SD2BinghamDistributed 2 # bingham_dispersed_bundle = SD2BinghamDistributed(models=[stick, zeppelin]) 3 # bingham_dispersed_bundle.parameter_names ~/anaconda3/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_) ~/anaconda3/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_) ~/anaconda3/lib/python3.6/importlib/_bootstrap.py in _load_unlocked(spec) ~/anaconda3/lib/python3.6/importlib/_bootstrap.py in _load_backward_compatible(spec) ~/anaconda3/lib/python3.6/site-packages/dmipy-0.1.dev0-py3.6.egg/dmipy/distributions/distribute_models.py in ----> 1 from . import distributions 2 from collections import OrderedDict 3 from itertools import chain 4 from ..utils.spherical_convolution import sh_convolution 5 from ..utils.utils import T1_tortuosity, parameter_equality ~/anaconda3/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_) ~/anaconda3/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_) ~/anaconda3/lib/python3.6/importlib/_bootstrap.py in _load_unlocked(spec) ~/anaconda3/lib/python3.6/importlib/_bootstrap.py in _load_backward_compatible(spec) ~/anaconda3/lib/python3.6/site-packages/dmipy-0.1.dev0-py3.6.egg/dmipy/distributions/distributions.py in 37 log_bingham_normalization_splinefit = np.load( 38 join(DATA_PATH, ---> 39 "bingham_normalization_splinefit.npz"), encoding='bytes')['arr_0'] 40 41 inverse_sh_matrix_kernel = { ~/anaconda3/lib/python3.6/site-packages/numpy/lib/npyio.py in __getitem__(self, key) 260 return format.read_array(bytes, 261 allow_pickle=self.allow_pickle, --> 262 pickle_kwargs=self.pickle_kwargs) 263 else: 264 return self.zip.read(key) ~/anaconda3/lib/python3.6/site-packages/numpy/lib/format.py in read_array(fp, allow_pickle, pickle_kwargs) 690 # The array contained Python objects. We need to unpickle the data. 691 if not allow_pickle: --> 692 raise ValueError("Object arrays cannot be loaded when " 693 "allow_pickle=False") 694 if pickle_kwargs is None: ValueError: Object arrays cannot be loaded when allow_pickle=False
rutgerfick commented 5 years ago

This is with the standard NODDI-Bingham implementation?

It seems the problem is in the Pickling - which means it's multi-processing related. Does the fitting of the model work if you don't use multi-processing?

You can test this by setting model.fit(...., use_parallel_processing=False)

foxet commented 5 years ago

This is with the standard NODDI-Bingham implementation?

It seems the problem is in the Pickling - which means it's multi-processing related. Does the fitting of the model work if you don't use multi-processing?

this is the example file provided by the dmipy document and I try other model(verdict), works well with model.fit(...., use_parallel_processing=False) or use_parallel_processing=True

e1 e2

rutgerfick commented 5 years ago

Thanks @foxet ! Seems it has something to do with numpy upgrading, setting the default of allow_pickle=False of np.load() by default for security reasons.

I merged a fix for it for the master. Can you update your dmipy repository and see if you still have the problem?

foxet commented 5 years ago

Thanks @foxet ! Seems it has something to do with numpy upgrading, setting the default of allow_pickle=False of np.load() by default for security reasons.

I merged a fix for it for the master. Can you update your dmipy repository and see if you still have the problem?

it works now !!,
thans for your help, rutgerick