简体   繁体   English

Keras安装的Tensorflow会覆盖Tensorflow-GPU安装

[英]Tensorflow installed by Keras overrides Tensorflow-GPU Installation

I am having a slight issue while trying to make use of keras.preprocessing.text.Tokenizer class. 我在尝试使用keras.preprocessing.text.Tokenizer类时遇到一个小问题。 I've recently installed Tensorflow-GPU and everything worked perfectly fine until I tried to install Keras. 我最近安装了Tensorflow-GPU,在我尝试安装Keras之前,一切工作都很好。

When I installed Keras using Anaconda, I saw that it installed Tensorflow 1.3 as well. 当我使用Anaconda安装Keras时,我看到它也安装了Tensorflow 1.3。 Thing is, it did not DOWNGRADE previously installed Tensorflow-GPU version. 事实是,它没有降级以前安装的Tensorflow-GPU版本。 Now that I try to run my python code, nothing happens, here is screenshot (Note: there should be some printing and processing happening): 现在,我尝试运行python代码,没有任何反应,这是屏幕截图(注意:应该进行一些打印和处理):

在此处输入图片说明

When I try to run python shell and check for Tensorflow version, I get the one that Keras installed. 当我尝试运行python shell并检查Tensorflow版本时,得到了Keras安装的版本。 So I tried to install Tensorflow-GPU again, but it saids that all requirements have been satisfied. 因此,我尝试再次安装Tensorflow-GPU,但它表示已满足所有要求。

How do I get the functionality I need from Keras, but still keep my Tensorflow-GPU installed? 如何从Keras获得所需的功能,但仍然保持Tensorflow-GPU的安装状态? And why is my code not even trying to run even on Tensorflow 1.3 that Keras installed with it? 为什么我的代码甚至不尝试在Keras所安装的Tensorflow 1.3上运行?

I have fixed the issue by using pip install keras instead of conda install -c anaconda keras . 我通过使用pip install keras而不是conda install -c anaconda keras解决了该问题。 By using pip I am only installing keras, and not dependencies that Anaconda includes with it. 通过使用pip,我仅安装keras,而不安装Anaconda附带的依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM