gpt4 book ai didi

python - Theano : MissingGxx , g++ 不可用

转载 作者:行者123 更新时间:2023-11-28 18:31:08 24 4
gpt4 key购买 nike

我一直在尝试部署我的 Python Flask 应用程序,该应用程序使用 Conv 网络在本地 IIS 上使用 Theano。当我尝试加载腌制的神经网络时,出现以下错误

Unable to Create compiledir.

我通过更改 configdefaults.py 中的 compiledir 路径并在该目录上授予 IIS 读/写权限来解决此问题。现在已创建 compiledir。

Now I'm getting MissingGXX error "g++ not available! We can't compile c code.". G++ is there in my PythonFolder\Scripts and I've added this path to my environmental variable PATH.

我只是想知道是什么导致了这个错误?是因为theano找不到g++,都是路径问题还是跟compiledir lock有关系

PS:我可以从我的 Winpython 控制台运行代码,一切正常。我已经从我的 Win python 控制台看到了 %PATH% 和 %PYTHONPATH% 的内容,并在我部署的 IIS Web 应用程序上复制了相同的内容。

这是堆栈跟踪的 header :

(MissingGXX('The following error happened while compiling the node', Shape_i{0}(input.input), '\n', "g++ not available! We can't compile c code.", '[Shape_i{0}(input.input)]'), , (

最佳答案

我已经解决了这个问题,我的 WinPython 环境中有两个 g++ 可执行文件,路径如下

  1. WinPythonDir\python-2.7.10.amd64\Scripts\g++.exe
  2. WinPythonDir\python-2.7.10.amd64\share\mingwpy\bin\g++.exe

Spyder 使用了正确的一个 (2),IIS 似乎使用了 1 中提到的那个。我在 IIS 上的 PATH 环境变量中明确添加了到 2 的路径。 Spyder 在 PATH 中没有 2(这很奇怪)但是它使用了 2 中提到的那个(我在登录 Theano 文件后确认)。

在此之后,我的 MissingGxx 错误消失了,但现在 Theano 无法创建编译目录,因为 IIS 使用系统配置文件,而 Theano 使用该配置文件生成 compile_dir 的路径,它位于 C;|Windows|System32\config\SystemsProfile| 中的某处Theano\compile_dir 和 IIS 没有权限(Spyder 使用我的本地 USERPROFILE)。我更改了Theano的configdefaults.py中的default_base_compiledir路径,并赋予IIS访问和修改的权限。我无法在 SystemsProfile 中为之前的 compiledir 分配权限,因为该位置非常敏感并且操作系统限制我这样做。

PS : 我复制了 PATH

echo %PATH%

从我的 WinPython 控制台和连接的 g++ 路径在 2 中提到并添加到 IIS 上的 PATH 变量,因为 WinPython PATH 变量中没有 2。

关于python - Theano : MissingGxx , g++ 不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37255003/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com