Python Forum
Installing keras in Python 2.7 environment
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing keras in Python 2.7 environment
#4
Probably not. It's an older Keras which was not as tightly bound to Tensorflow, in fact would support a couple of other back end engines.

Looking around, I saw this on Stack Overflow:
Quote:13

If you only need TensorFlow because of Keras and your are on Python 2.7.x, you can avoid installing Tensorflow(Google) and replace it by CNTK(Microsoft). According to Jeong-Yoon Lee CNTK is a lot (about 2 to 4 times) faster than TensorFlow for LSTM (Bidirectional LSTM on IMDb Data and Text Generation via LSTM), while speeds for other type of neural networks are close to each other. Your Keras code does not need to be modified (I checked it with 2 examples of Keras using TensorFlow and succesfully replaced TensorFlow with CNTK, without changing anything the Keras code.

So how do you install it?

-CPU-only version of CNTK:

pip install https://cntk.ai/PythonWheel/CPU-Only/cnt..._amd64.whl

-GPU version of CNTK:

pip install https://cntk.ai/PythonWheel/GPU/cntk-2.4..._amd64.whl

-Test CNTK install:

python -c "import cntk; print(cntk.version)"

-Install Keras: The Python Deep Learning library

pip install keras

-Enable CNTK as Keras back end iso TensorFlow

modify the "keras.json" file under %USERPROFILE%/.keras

{
"epsilon": 1e-07,
"image_data_format": "channels_last",
"backend": "cntk",
"floatx": "float32"
}

You are unlikely to be able to install Tensorflow v2. You might see if THIS version will install
Reply


Messages In This Thread
RE: Installing keras in Python 2.7 environment - by jefsummers - Nov-01-2020, 08:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Installing python packages in a virtual environment Led_Zeppelin 1 936 Aug-15-2023, 08:18 PM
Last Post: deanhystad
  Understanding venv; How do I ensure my python script uses the environment every time? Calab 1 2,569 May-10-2023, 02:13 PM
Last Post: Calab
  Python development environment standenman 3 1,873 May-04-2023, 07:24 PM
Last Post: snippsat
  Python Scripting Environment jpotter0 1 1,930 Nov-19-2022, 03:07 PM
Last Post: snippsat
  How do I link the virtual environment of that project to the 3.9.2 version of python? Bryant11 1 1,493 Feb-26-2022, 11:15 AM
Last Post: Larz60+
  VS Code debugger using wrong Python environment topfox 0 2,645 Jun-09-2021, 10:01 AM
Last Post: topfox
  It says there is no keras in jupyter notebook. it is wrong there is a keras install Led_Zeppelin 0 1,979 Apr-27-2021, 08:29 PM
Last Post: Led_Zeppelin
  Virtual environment and upgrading python 3.5 to 3.9 NeilUK 4 12,545 Jan-24-2021, 01:02 PM
Last Post: snippsat
  Python in Linux environment on RPI kendias 22 11,689 Sep-05-2020, 03:04 AM
Last Post: K_Research
  Unable to install virtual environment on python 3.8.3 Allen10 4 3,323 Jun-04-2020, 04:22 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020