在我的Windows 10工作站上安装Theano和Keras

2024-04-26 17:35:26 发布

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

我试图用Keras开发Python中的神经网络,在我的windows10工作站Anaconda3(包括它的所有库:numpy、scikit learn、pandas、SciPy和matplotlib)上安装后,我意识到还需要TensorFlow或Theano。在

在我安装TensorFlow失败后,我下载并能够安装Theano,但是尝试从Python提示符导入它时,我收到了以下消息:

WARNING: "g ++ not detected! Theano will be unable to execute optimized C implementations (for both CPU and GPU) and will default to Python implementations. Performance will be several degraded. To remove this warning, set Theano flags cxx to an empty string"

希望通过这种方式解决这个问题,我下载了GNU编译器,用于C++ CygWi64,但是没有任何改变!承认这确实是向前迈进的正确方法,我应该如何访问“Theano flags cxx”?在


Tags: andtotensorflowcxx神经网络theanobewill
1条回答
网友
1楼 · 发布于 2024-04-26 17:35:26

首先,在没有g++的情况下运行theano是唯一的性能问题。这是一个警告,而不是例外,当导入它。在

但是在使用像keras这样的深度学习库时,您可能需要性能,所以让我们尝试修复theano安装。在

请按照theano docs有关在windows上安装NO的说明操作。您可能需要清除以前安装的需求。在

要安装gcc,请遵循this section,其中说明:

Theano C code compiler currently requires a GCC installation. We have used the build TDM GCC which is provided for both 32- and 64-bit platforms...

按照安装说明从here下载。在

张量流

我建议使用tensorflow,因为keras最近将默认后端从theano更改为tensorflow。在

使用anacondapip你应该很容易做到{},而且它会起作用的。在

实际上,今天我刚刚在Windows10上安装了keras和{},只需运行pip install keras tensorflow,所以我建议您尝试全新的Python和python安装,然后再试一次。在

如果安装成功或在安装ano/tensorflow/keras时遇到其他问题,请更新

相关问题 更多 >