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

NUMPY 1.20 above error: TypeError: expected dtype object, got 'numpy.dtype[float64]' #118

Open
pinghongyeh opened this issue Mar 31, 2022 · 0 comments

Comments

@pinghongyeh
Copy link

Hi Rutger,

I have encounterd errors while running NODDI_mod_watson.fit,

Here is the error

NODDI_fit_watson = NODDI_mod_watson.fit(gtab_dmipy, data, mask=mask)
File "/home/yehp/anaconda3/lib/python3.7/site-packages/dmipy/core/modeling_framework.py", line 1201, in fit
self, self.scheme, x0_, Ns, N_sphere_samples)
File "/home/yehp/anaconda3/lib/python3.7/site-packages/dmipy/optimizers/brute2fine.py", line 76, in init
model, x0_vector_, Ns, N_sphere_samples)
File "/home/yehp/anaconda3/lib/python3.7/site-packages/dmipy/optimizers/brute2fine.py", line 168, in precompute_signal_grid
self.acquisition_scheme, self.parameter_grid)
File "/home/yehp/anaconda3/lib/python3.7/site-packages/dmipy/core/modeling_framework.py", line 1300, in simulate_signal
E_2d[i] = self(acquisition_scheme, **parameters)
File "/home/yehp/anaconda3/lib/python3.7/site-packages/dmipy/core/modeling_framework.py", line 1370, in call
acquisition_scheme_or_vertices, **parameters))
File "/home/yehp/anaconda3/lib/python3.7/site-packages/dmipy/distributions/distribute_models.py", line 390, in call
return self.sh_convolved_model(acquisition_scheme, **kwargs)
File "/home/yehp/anaconda3/lib/python3.7/site-packages/dmipy/distributions/distribute_models.py", line 482, in sh_convolved_model
**distribution_parameters)
File "/home/yehp/anaconda3/lib/python3.7/site-packages/dmipy/distributions/distributions.py", line 149, in spherical_harmonics_representation
watson_sf = self(hemisphere.vertices, mu=mu, odi=odi)
File "/home/yehp/anaconda3/lib/python3.7/site-packages/dmipy/distributions/distributions.py", line 123, in call
mu_cart = utils.unitsphere2cart_1d(mu)
TypeError: expected dtype object, got 'numpy.dtype[float64]'

I have numpy=1.21.1 installed. The scripts ran fine using numpy< 1.18.0
It seems that API change in numpy has caused this issue, see
numba/numba#6041

I wonder if you plan to upgrade dmipy for the current version of numpy.

Thank you.
Ping

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

1 participant