【问题标题】:g++.exe: error: No such file or directoryg++.exe:错误:没有这样的文件或目录
【发布时间】:2017-05-19 20:33:57
【问题描述】:

我在 IPython 上运行此代码。我正面临这个问题。对于解决此问题的建议或帮助,我将不胜感激。

我使用 theano 作为后端

import numpy
from keras.datasets import imdb
from matplotlib import pyplot
from pylab import *

# load the dataset

(X_train, y_train), (X_test, y_test) = imdb.load_data()
X = numpy.concatenate((X_train, X_test), axis=0)
y = numpy.concatenate((y_train, y_test), axis=0)

g++.exe:错误:Amjad\AppData\Local\Theano\compiledir_Windows-10-10.0.15063-SP0-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-3.5.3-64\lazylinker_ext\lazylinker_ext.pyd:没有这样的文件或目录 g++.exe:错误:Amjad\AppData\Local\Theano\compiledir_Windows-10-10.0.15063-SP0-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-3.5.3-64\lazylinker_ext\mod.cpp:没有这样的文件或目录

【问题讨论】:

    标签: python artificial-intelligence deep-learning keras


    【解决方案1】:

    对于 g++ 编译器,我必须从 here(不带 git 的版本)安装 MinGW。

    然后将其“bin”目录添加到 PATH 环境变量中。通常它是C:\MinGW\bin 文件夹,或者您安装它的位置。

    (如果您已经安装了 g++ 编译器,请将其路径添加到环境变量)

    之后,如果出现关于hypot 的错误,则将其添加到名为.theanorc 的文件中,通常在C:\Users\yourUser 中。 (如果您无法通过 Windows 资源管理器创建它,请使用记事本保存)。

    [gcc]
    cxxflags = -D_hypot=hypot
    

    始终避免在名称中带有空格的文件夹中安装任何内容! Theano 无法识别这些文件夹并会带来错误。如果您对此有疑问,可以查看以下内容:

    【讨论】:

      猜你喜欢
      • 2013-11-26
      • 2021-08-21
      • 2011-12-19
      • 1970-01-01
      • 2016-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多