-1

尝试运行 UMAP 会导致错误:

import pandas as pd
import numpy as np
import umap

df = pd.DataFrame(np.arange(25).reshape(-1,5))

um = umap.UMAP(random_state=0)
um.fit(df)

PicklingError: ("Can't pickle <class 'numpy.dtype[float32]'>: it's not found as numpy.dtype[float32]", 'PicklingError while hashing array([[ 0., 1., 2., 3 ., 4.],\n [ 5., 6., 7., 8., 9.],\n [10., 11., 12., 13., 14.],\n [15., 16., 17., 18., 19.],\n
[20., 21., 22., 23., 24.]], dtype=float32): PicklingError("Can't pickle <class 'numpy. dtype[float32]'>: 找不到 numpy.dtype[float32]")')

我该如何解决这个问题?

4

1 回答 1

0

问题似乎出在 Numpy 上。遇到此错误时,我正在运行 1.20。降级与

pip install numpy==1.19

解决它。

于 2021-03-14T02:34:08.220 回答