小编MJ.*_*hin的帖子

Numpy安装错误.(Mingw32CCompiler实例没有属性'compile_options')

我使用python与windows8/anaconda spyder(2.7)我试图更新Theano最新.当我安装theano时

"pip install --upgrade theano"
Run Code Online (Sandbox Code Playgroud)

错误发生在numpy安装部分.

虽然numpy可以在anaconda GUI中使用,但是在anaconda终端中没有显示.(pip show numpy什么都没输出)

错误如下(当我尝试安装numpy时,会发生同样的错误)

  File "c:\users\user\appdata\local\temp\pip_build_user\numpy\numpy\distutils\command\build_src.py", line 329, in build_extension_sources

    sources = self.generate_sources(sources, ext)

  File "c:\users\user\appdata\local\temp\pip_build_user\numpy\numpy\distutils\command\build_src.py", line 386, in generate_sources

    source = func(extension, build_dir)

  File "numpy\core\setup.py", line 455, in generate_config_h

    rep = check_long_double_representation(config_cmd)

  File "numpy\core\setup_common.py", line 191, in check_long_double_representation

    cmd.compiler.compile_options.remove("/GL")

AttributeError: Mingw32CCompiler instance has no attribute 'compile_options'

----------------------------------------
Cleaning up...
  Removing temporary dir c:\users\user\appdata\local\temp\pip_build_user...
Command C:\Anaconda\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\user\\appdata\\local\\temp\\pip_build_user\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\user\appdata\local\temp\pip-nm4fpu-record\install-record.txt --single-version-externally-managed --compile failed with …
Run Code Online (Sandbox Code Playgroud)

numpy theano

19
推荐指数
1
解决办法
656
查看次数

numpy数组大小与连接速度

我将数据连接到一个像这样的numpy数组:

xdata_test = np.concatenate((xdata_test,additional_X))
Run Code Online (Sandbox Code Playgroud)

这已经完成了一千次.数组有dtype float32,它们的大小如下所示:

xdata_test.shape   :  (x1,40,24,24)        (x1 : [500~10500])   
additional_X.shape :  (x2,40,24,24)        (x2 : [0 ~ 500])
Run Code Online (Sandbox Code Playgroud)

问题是当x1大于~2000-3000时,连接需要更长的时间.

下图显示了连接时间与x2维度大小的关系:

x2与时间消耗

这是一个记忆问题还是numpy的基本特征?

python performance numpy

5
推荐指数
2
解决办法
882
查看次数

标签 统计

numpy ×2

performance ×1

python ×1

theano ×1