简体   繁体   English

Python / Numpy错误:PyObject_Call中没有错误的NULL结果

[英]Python/Numpy error: NULL result without error in PyObject_Call

I've never seen this error before, and none of the hits on Google seem to apply. 我以前从未见过此错误,而且Google上的任何点击都似乎不适用。 I've got a very large NumPy array that holds Boolean values. 我有一个非常大的NumPy数组,其中包含布尔值。 When I try writing the array using numpy.dump(), I get the following error: 当我尝试使用numpy.dump()编写数组时,出现以下错误:

SystemError: NULL result without error in PyObject_Call SystemError:NULL结果,PyObject_Call中没有错误

The array is initialized with all False values, and the only time I ever access it is to set some of the values to True, so I have no idea why any of the values would be null. 该数组使用所有False值初始化,而我唯一访问过的就是将其中一些值设置为True,因此我不知道为什么其中任何一个值都为null。

When I try running the same program with a smaller array, I get no error. 当我尝试使用较小的数组运行同一程序时,没有任何错误。 However, since the error occurs at the writing step, I don't think that it's a memory issue. 但是,由于该错误发生在编写步骤中,所以我认为这不是内存问题。 Has anybody else seen this error before? 其他人以前见过这个错误吗?

That message comes directly from the CPython interpreter (see abstract.c method PyObject_Call). 该消息直接来自CPython解释器(请参见abstract.c方法PyObject_Call)。 You may get a better response on a Python or NumPy mailing list regarding that error message because it looks like a problem in C code. 关于该错误消息,您可能会在Python或NumPy邮件列表上得到更好的响应,因为它看起来像C代码中的问题。

Write a simple example to demonstrating the problem and you should be able to narrow the issue down to a module then a method. 编写一个简单的示例来演示问题,您应该可以将问题缩小到模块然后是方法。

It appears that this may have been an error from using the 32-bit version of NumPy and not the 64 bit. 看来这是使用32位版本的NumPy而不是64位版本引起的错误。 For whatever reason, though the program has no problem keeping the array in memory, it trips up when writing the array to a file if the number of elements in the array is greater than 2^32. 无论出于何种原因,尽管程序将数组保留在内存中没有问题,但是如果数组中的元素数大于2 ^ 32,则在将数组写入文件时会跳闸。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 NULL结果,PyObject_Call中没有错误 - NULL result without error in PyObject_Call 多重处理:NULL结果,PyObject_Call中没有错误 - Multiprocessing : NULL result without error in PyObject_Call gevent + redis-py:SystemError:在PyObject_Call中没有错误的NULL结果 - gevent + redis-py: SystemError: NULL result without error in PyObject_Call 尝试在scikit-learn中并行化参数搜索会导致“ SystemError:PyObject_Call中没有错误的NULL结果” - Trying to parallelize parameter search in scikit-learn leads to “SystemError: NULL result without error in PyObject_Call” Python-SystemError:NULL结果,PyObject调用中没有错误 - Python - SystemError: NULL result without error in PyObject call PyObject_Call崩溃 - Crash in PyObject_Call 来自SWIG PyObject_Call Segfault的Python回调 - Python Callback from SWIG PyObject_Call Segfault 从线程调用 PyObject_Call 导致堆栈溢出 - Calling PyObject_Call from thread causes stack overflow iTunes共享库中带有PyObject_Call()的分段错误 - Segmentation-fault with PyObject_Call() in shared library for iTunes PyObject_GetAttrString C++ 函数返回 NULL:无法从 C++ 调用 Python 函数 - PyObject_GetAttrString C++ function returning NULL: Unable to call Python functions from C++
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM