numpyasarray float32可以在Ubuntu上运行,但不能在windows7上运行

2024-04-26 18:13:55 发布

您现在位置:Python中文网/ 问答频道 /正文

更新

如果有必要投否决票的话,批评就好了。这个问题已经被修改了。在

我按照指示here

已检查步骤1和2。我的Intel(R) Core(TM) i7-2860QM CPU @ 2.50GHzCPU可以支持64位和Intel virtualization技术,根据我的BIOS,它目前正在使用虚拟化技术。检查步骤3:我在Ubuntu上,所以没有防病毒软件,也没有运行任何系统级的调试。现在请看所附的图像,尽管我将VM设置为左侧的64位,但右侧仍然是32位。在

enter image description here

我知道这些设置只是为了组织的目的,它们实际上不能改变虚拟机的位。我在这里下载了虚拟机-https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/linux/。它们都没有标记为64位,所以我不知道如何保证我有一个64位的Windows映像

不过,这并不是我要解决的主要问题。据推断,这是我的主要问题。在


同样的代码可以在Ubuntu14.04上运行,但在Windows7VM上不行。下面你会看到我调试和所有变量看起来都一样。在

enter image description here

下一步,我在控制台中输入导致错误的行,确信在一个操作系统上我们没有问题,而在另一个操作系统上,我们会崩溃

enter image description here

>>> np.asarray(frames, dtype=np.float32)
    Traceback (most recent call last):
      File "C:\Program Files\JetBrains\PyCharm 2016.1.2\helpers\pydev\_pydevd_bundle\pydevd_exec.py", line 3, in Exec
        exec exp in global_vars, local_vars
      File "<input>", line 1, in <module>
      File "C:\Python27\lib\site-packages\numpy\core\numeric.py", line 482, in asarray
        return array(a, dtype, copy=False, order=order)
    MemoryError

现在让我毛骨悚然的部分。当我从Ubuntu的控制台返回debugging选项卡时,我看到许多新的变量自发地被创建了,尽管我只在python控制台中输入了一行

enter image description here

enter image description here

我想应该是包裹问题。在

我在Windows7VM上使用了Python2.7.11,这些包已经安装好了

^{pr2}$

在Ubuntu上,令我惊讶的是,我使用的是python2.7.6(由于某种原因,当我试图升级到2.7.11时,我得到了一个make: *** [libinstall] Error 1,但这是另一个问题)。下面是我在Ubuntu上安装的软件包

BeautifulSoup   3.2.1   3.2.1
CherryPy    3.2.2   5.3.0
Cython  0.22    0.24
Django  1.9.1   1.9.6
Markdown    2.4 2.6.6
PAM 0.4.2   
Pillow  2.3.0   3.2.0
PyOpenGL    3.0.2   3.1.1a1
Pygments    1.6 2.1.3
Routes  2.0 2.3.1
Twisted-Core    13.2.0  
Twisted-Web 13.2.0  
VTK 5.8.0   
WebOb   1.3.1   1.6.0
adium-theme-ubuntu  0.3.4   
amqplib 1.0.2   1.0.2
apptools    4.3.0   4.4.0
apsw    3.8.2-r1    3.9.2-r1
apt-xapian-index    0.45    
argparse    1.2.1   1.4.0
astropy 1.1.2   1.1.2
cffi    0.8.6   1.6.0
chardet 2.0.1   2.3.0
colorama    0.2.5   0.3.7
command-not-found   0.3 
configobj   5.0.6   5.0.6
cssselect   0.9.1   0.9.1
cssutils    0.9.10  1.0.1
debtagshw   0.1 
defer   1.0.6   1.0.4
deluge  1.3.6   
dirspec 13.10   13.08
dnspython   1.11.1  1.12.0
duplicity   0.6.23  
envisage    4.1.0   4.5.1
feedparser  5.1.3   5.2.1
h5py    2.2.1   2.6.0
html5lib    0.999   0.9999999
httplib2    0.8 0.9.2
image-registration  0.2.2.dev272    
ipython 3.1.0   4.2.0
libtfr  1.0.4   2.0.0b4
lockfile    0.8 0.12.2
lxml    3.3.3   3.6.0
matplotlib  1.4.3   1.5.1
mayavi  4.4.3   4.4.4
mechanize   0.2.5   0.2.5
mock    1.0.1   2.0.0
netifaces   0.8 0.10.4
nose    1.3.7   1.3.7
numexpr 2.2.2   2.5.2
numpy   1.9.2   1.11.0
oauthlib    0.6.1   1.1.1
oneconf 0.3.7.14.04.1   0.0.1.dev0
pandas  0.16.1  0.18.1
parmap  1.2.3   1.2.3
pexpect 3.1 4.0.1
pip 1.5.4   8.1.1
piston-mini-client  0.7.5   0.7.5
plotly  1.6.17  1.9.10
ply 3.4 3.8
py  1.4.31  1.4.31
pyFFTW  0.9.2   0.10.1
pyOpenSSL   0.13    16.0.0
pycparser   2.10    2.14
pycrypto    2.6.1   2.6.1
pycups  1.9.66  1.9.73
pyface  5.0.0   5.1.0
pygame  1.9.1release    
pygobject   3.12.0  
pygpgme 0.3 0.3
pyparsing   2.0.3   2.1.1
pyqtgraph   0.9.10  0.9.10
pyserial    2.6 3.0.1
pysmbc  1.0.14.1    1.0.15.5
pytest  2.9.1   2.9.1
python-apt  0.9.3.5ubuntu2  0.7.8
python-dateutil 2.4.2   2.5.3
python-debian   0.1.21-nmu2ubuntu2  0.1.23
python-libtorrent   0.16.13 1.1.0
pytz    2015.4  2016.4
pyxdg   0.25    0.25
pyzmq   14.7.0  15.2.0
reportlab   3.0 3.3.0
repoze.lru  0.6 0.6
requests    2.2.1   2.10.0
scikit-learn    0.17.1  0.17.1
scipy   0.15.1  0.17.0
sessioninstaller    0.0.0   
setuptools  3.3 21.0.0
simplejson  3.7.3   3.8.2
six 1.5.2   1.10.0
sklearn 0.0 0.0
software-center-aptd-plugins    0.0.0   
system-service  0.1.6   
tables  3.1.1   3.2.2
traits  4.5.0   4.5.0
traitsui    5.0.0   5.1.0
uTidylib    0.2 0.2
unity-lens-photos   1.0 
urllib3 1.7.1   1.15.1
vboxapi 1.0 1.0
wheel   0.24.0  0.29.0
wsgiref 0.1.2   0.1.2
wxPython    2.8.12.1    2.9.1.1
wxPython-common 2.8.12.1    2.6.3.3
xdiagnose   3.6.3build2 
xppy    0.7.0   
zope.interface  4.0.5   4.1.3

Tags: inpycoreubuntunpline步骤技术
1条回答
网友
1楼 · 发布于 2024-04-26 18:13:55

你有记忆错误。意味着您请求的分配超出了虚拟机上的可用内存。一些潜在原因:

  • 为VM分配的内存不足(请尝试增加)
  • Windows上进程的2GB限制(运行LargeAddressWare python或移动到64位)
  • 内存损坏导致堆损坏(调试代码)

类似讨论Memory errors and list limits?

相关问题 更多 >