Skip to content

numpy._core._exceptions._ArrayMemoryError #310

@YoushanLiu

Description

@YoushanLiu

print(x.shape)
print(y.shape)
print(data.shape)

Ok = OrdinaryKriging(x, y, data,
variogram_model='linear',
verbose=True,
enable_plotting=True,
)


(814084,)
(814084,)
(814084,)
Plotting Enabled

Adjusting data for anisotropy...
Initializing variogram model...
Traceback (most recent call last):
File "/run/media/JZ/test/./test_PyKriging.py", line 198, in
Ok = OrdinaryKriging(x=X, y=Y, z=data,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib64/python3.12/site-packages/pykrige/ok.py", line 321, in init
) = _initialize_variogram_model(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib64/python3.12/site-packages/pykrige/core.py", line 433, in _initialize_variogram_model
d = pdist(X, metric="euclidean")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib64/python3.12/site-packages/scipy/spatial/distance.py", line 2300, in pdist
return xpx.lazy_apply(_np_pdist, X, out,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib64/python3.12/site-packages/scipy/_lib/array_api_extra/_lib/_lazy.py", line 300, in lazy_apply
out = wrapped(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib64/python3.12/site-packages/scipy/_lib/array_api_extra/_lib/_lazy.py", line 350, in wrapper
out = func(*args_list, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib64/python3.12/site-packages/scipy/spatial/distance.py", line 2338, in _np_pdist
return pdist_fn(X, out=out, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
numpy._core._exceptions._ArrayMemoryError: Unable to allocate 2.41 TiB for an array with shape (331365972486,) and data type float64

It is very strange! The length of the data is 814084, the total size is 81408483/1024/1024=18.6329 MB.
Why it consumes 2.41 TiB. The number 331365972486 is strange.

Sorry, I'm tring this great library for the first time. Is there something wrong?

How to apply this library for the above problem?

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions