我正在尝试通过《The Straight Dope》学习 MXNET。在学习线性代数 – 张量部分时,运行以下代码时遇到了 ctypes 错误,
X = nd.arange(24).reshape((2, 3, 4))
错误信息如下,
C:\Anaconda2\lib\site-packages\mxnet\ndarray\ndarray.pyc in reshape(self, *shape, **kwargs) 1060 c_array(ctypes.c_int64, shape), 1061 reverse,-> 1062 ctypes.byref(handle))) 1063 return NDArray(handle=handle, writable=self.writable) 1064WindowsError: exception: access violation writing 0x00007FFB00000000
为什么会发生这种情况?我该如何解决这个问题?
回答:
在这里讨论了解决方案:https://discuss.mxnet.io/t/reshape-error-calling-ctypes/1245/3
有效的解决方法是将 mxnet 降级到 1.2.0 版本,并将 Python 升级到 2.7.15 版本。