spyder: python: theano: 如何在spyder中禁用警告?
我在用Theano跑机器学习算法,最近收到了很多来自numpy包的弃用警告(DeprecationWarning)。我想要关闭这些警告,请给我一些建议。
警告的内容是:fromnumeric.py:932: DeprecationWarning: 将一个维度大于0的数组转换为索引将来会导致错误。
我尝试过运行配置,添加命令行选项 -W ignore 或 -W ignore::DeprecationWarning,但这些都没有效果。
另外,如果能修复这个警告也可以。看起来在Theano中已经修复了这个问题,具体可以参考这个链接:https://groups.google.com/forum/#!topic/theano-users/Hf7soRrnh8w,但我不知道在哪里能找到这个更新版本的Theano。
我使用的是Anaconda 2.0.1版本,操作系统是Windows 8.1 - 64位。
谢谢!
1 个回答
1
请查看这个链接,以更新Theano到开发版本。这个问题应该会被修复:
http://deeplearning.net/software/theano/install.html#bleeding-edge-install-instructions
总的来说,你可以运行以下两个命令中的一个:
pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
或者(如果你只想为当前用户安装):
pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git --user