gpt4 book ai didi

ios - Kivy App在电话上出现“奇异矩阵”错误,但在计算机上却没有

转载 作者:行者123 更新时间:2023-12-01 21:23:59 30 4
gpt4 key购买 nike

我的自行编写的Kivy应用程序遇到了一个问题,我在网上找不到任何地方。非常感谢您的帮助。
问题如下。我的代码涉及numpy矩阵求逆,并且在计算机上运行时绝对可以正常工作。但是,一旦我在使用XCode的模拟iPhone或个人电话上运行它,即使所讨论的矩阵绝对不是单数,我也会收到LinAlgError("Singular matrix") numpy.linalg.LinAlgError: Singular matrix错误。
编辑:
在计算机上:
numpy版本:1.19.1numpy.show_config()的输出:

blas_mkl_info:
NOT AVAILABLE
blis_info:
NOT AVAILABLE
openblas_info:
libraries = ['openblas', 'openblas']
library_dirs = ['/usr/local/lib']
language = c
define_macros = [('HAVE_CBLAS', None)]
blas_opt_info:
libraries = ['openblas', 'openblas']
library_dirs = ['/usr/local/lib']
language = c
define_macros = [('HAVE_CBLAS', None)]
lapack_mkl_info:
NOT AVAILABLE
openblas_lapack_info:
libraries = ['openblas', 'openblas']
library_dirs = ['/usr/local/lib']
language = c
define_macros = [('HAVE_CBLAS', None)]
lapack_opt_info:
libraries = ['openblas', 'openblas']
library_dirs = ['/usr/local/lib']
language = c
define_macros = [('HAVE_CBLAS', None)]
在模拟电话上:
numpy版本: 1.16.4 numpy.show_config()的输出:
lapack_mkl_info:
NOT AVAILABLE
openblas_lapack_info:
NOT AVAILABLE
openblas_clapack_info:
NOT AVAILABLE
atlas_3_10_threads_info:
NOT AVAILABLE
atlas_3_10_info:
NOT AVAILABLE
atlas_threads_info:
NOT AVAILABLE
atlas_info:
NOT AVAILABLE
accelerate_info:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
lapack_opt_info:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]

最佳答案

造成问题的原因几乎可以肯定是链接程序参数中的-Wl,Accelerate。 Accelerate附带了非常旧的LAPACK版本,这就是为什么从https://github.com/numpy/numpy/pull/15759(未发行1.20)开始完全不再支持的原因。
如果您可以在环境变量中设置ATLAS=None BLAS=None LAPACK=None来重建kivy的numpy,那么最终您将没有这种Accelerate依赖性。
您可能需要从https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/recipes/numpy/__init__.py处开始挖掘,以弄清楚如何将其传递给kivy。

关于ios - Kivy App在电话上出现“奇异矩阵”错误,但在计算机上却没有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63594249/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com