ValueError: Unable to avoid copy while creating an array as requested.
If using `np.array(obj, copy=False)` replace it with `np.asarray(obj)` to allow a copy when needed (no behavior change in NumPy 1.x).
For more details, see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.
记录:使用fasttext,用的好好的突然就不能用了。排除代码的原因。
解决办法:
找到 FastText.py 文件的 predict 方法的实现部分,找到这段代码:
return labels, np.array(probs, copy=False)
将其替换为:
return labels, np.asarray(probs)