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

dtype mismtach expected 'long' but got 'long long' #5

Open
ivan-marroquin opened this issue Jun 7, 2021 · 4 comments
Open

dtype mismtach expected 'long' but got 'long long' #5

ivan-marroquin opened this issue Jun 7, 2021 · 4 comments
Assignees

Comments

@ivan-marroquin
Copy link

Hi,

Many thanks for making this clustering package available!

I have a windows machine with Python 3.6.5, numpy 1.19.5, scipy 1.5.4, scikit-learn 0.24.2

I did a manual installation by running command "python setup.py install". It went OK and then, I tried to test the installation following Python code in one of examples:

data_F1= pd.read_csv('Fig1.dat', sep=" ", header= None)
est= DPA.DensityPeakAdvanced(Z= 1.5)
est.fit(data_F1)

The last line produced the following error message:

Traceback (most recent call last):
File "", line 1, in
File "C:\Temp\Python\Python3.6.5\lib\site-packages\dpapipeline-0.0.2-py3.6-win-amd64.egg\Pipeline\DPA.py", line 400, in fit
frac=self.frac, dim=self.dim_, n_jobs=self.n_jobs).fit(X)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\dpapipeline-0.0.2-py3.6-win-amd64.egg\Pipeline\PAk.py", line 282, in fit
dim=self.dim_)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\dpapipeline-0.0.2-py3.6-win-amd64.egg\Pipeline\PAk.py", line 65, in _PointAdaptive_kNN
k_hat, dc, densities, err_densities = _PAk.get_densities(dim, distances, k_max, D_thr, indices)
File "src\Pipeline_PAk.pyx", line 84, in Pipeline._PAk.get_densities
ValueError: Buffer dtype mismatch, expected 'long' but got 'long long'

Thanks for your help,

Ivan

@mariaderrico
Copy link
Owner

Thanks for posting the bug error! I will provide an update shortly.

@mariaderrico mariaderrico self-assigned this Jun 23, 2021
mariaderrico added a commit that referenced this issue Jun 28, 2021
mariaderrico added a commit that referenced this issue Jun 29, 2021
@mariaderrico
Copy link
Owner

Hi. The problem was that the long type in the Cython codes are long for Linux, but long long for Windows. I have replaced them with int64_t (see commits above for more details). Those changes should solve the issue, could you give it a try?

@ivan-marroquin
Copy link
Author

Hi @mariaderrico ,

Many thanks for fixing the reported issue. I will give a try as soon as possible, and let you know.

Ivan

@ivan-marroquin
Copy link
Author

Hi @mariaderrico

I downloaded the zip file and manually installed the package. Run the same Python code and it worked fine.

I noticed the following warnings during the installation:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Temp\Python\Python3.6.5\lib\site-packages\numpy\core\include -IC:\Temp\Python\Python3.6.5\include -IC:\Temp\Python\Python3.6.5\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.24.28314\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.24.28314\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc\Pipeline_PAk.c /Fobuild\temp.win-amd64-3.6\Release\src\Pipeline_PAk.obj
_PAk.c
src\Pipeline_PAk.c(2729): warning C4244: '=': conversion from 'int64_t' to 'int', possible loss of data
src\Pipeline_PAk.c(3066): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
src\Pipeline_PAk.c(3220): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
src\Pipeline_PAk.c(3229): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /nodefaultlib:libucrt.lib ucrt.lib /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Temp\Python\Python3.6.5\libs /LIBPATH:C:\Temp\Python\Python3.6.5\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.24.28314\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.24.28314\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64" /EXPORT:PyInit__PAk build\temp.win-amd64-3.6\Release\src\Pipeline_PAk.obj /OUT:build\lib.win-amd64-3.6\Pipeline_PAk.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\src\Pipeline_PAk.cp36-win_amd64.lib

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