Как установить keras в anaconda
conda-forge / packages / keras 2.14.0
Deep Learning for Python
- License: Apache-2.0
- Home: https://github.com/keras-team/keras
- 3299722 total downloads
- Last upload: 2 days and 7 hours ago
Installers
Info: This package contains files in non-standard labels.
conda install
To install this package run one of the following:
conda install -c conda-forge keras conda install -c «conda-forge/label/broken» keras conda install -c «conda-forge/label/cf201901» keras conda install -c «conda-forge/label/cf202003» keras
Package installation of Keras in Anaconda?
Python 3.5, I am trying to find command to install a Keras Deep Learning package for Anaconda. The command conda install -c keras does not work, can anyone answer Why it doesn’t work?
6,456 2 2 gold badges 31 31 silver badges 60 60 bronze badges
asked Dec 15, 2016 at 11:33
51.1k 63 63 gold badges 179 179 silver badges 286 286 bronze badges
‘conda install -c kersa’ should be ‘conda install -c keras’ ?
Dec 15, 2016 at 11:46
@linpingta yes and «CondaValueError: Value error: too few arguments, must supply command line package specs or — — file»
Dec 15, 2016 at 13:16
I was able to install Keras using the steps listed at this post.
Nov 26, 2017 at 18:04
4 Answers 4
The specific answer to the question is that the -c option to the conda command specifies a channel to search for the package or packages you want to install.
-c CHANNEL, —channel CHANNEL
Additional channel to search for packages. These are URLs searched in the order they are given (including file:// for local directories). Then, the defaults or channels from .condarc are searched (unless —override-channels is given). You can use ‘defaults’ to get the default packages for conda, and ‘system’ to get the system packages, which also takes .condarc into account. You can also use any name and the .condarc channel_alias value will be prepended. The default channel_alias is http://conda.anaconda.org/.
Your command conda install -c keras specifies a channel called keras (on the default channel_alias url) but doesn’t then specify any packages to install, so that’s why you get the Value error: too few arguments error.
As Madhu Babu’s answer notes, keras is available on the conda-forge channel so the correct command is
conda install -c conda-forge keras
TensorFlow#
TensorFlow enables your data science, machine learning, and artificial intelligence workflows. This page shows how to install TensorFlow using the conda package manager included in Anaconda and Miniconda.
TensorFlow CPU with conda is supported on 64-bit Ubuntu Linux 16.04 or later and macOS 10.12.6 or later.
TensorFlow GPU with conda is only available though version 2.4.1 (2021). For the latest TensorFlow GPU installation, follow the installation instructions on the TensorFlow website.
Install TensorFlow#
- Download and install Anaconda or Miniconda.
- Open a terminal application and use the default bash shell.
- Choose a name for your TensorFlow environment, such as “tf”.
- Use the following commands to install the current release of TensorFlow. CPU-only is recommended for beginners.
CPU-only TensorFlow
conda create -n tf tensorflow conda activate tf
GPU TensorFlow
Note GPU TensorFlow is only available via conda for Windows and Linux.
conda create -n tf-gpu tensorflow-gpu conda activate tf-gpu
TensorFlow is now installed and ready to use.
For using TensorFlow with a GPU, refer to the TensorFlow documentation, specifically the section on device placement.
CUDA versions#
GPU TensorFlow uses CUDA. For a version compatibility table for GPU TensorFlow on Linux, see https://www.tensorflow.org/install/source#gpu. For Windows, see https://www.tensorflow.org/install/source_windows#gpu.
GPU TensorFlow conda packages are currently only supported for Windows or Linux.
TensorFlow 2.10 was the last release that supported GPU on Windows Native.
To install GPU TensorFlow with a non-default CUDA version like 9.0, run the following commands:
conda create -n tf-gpu-cuda9 tensorflow-gpu cudatoolkit=9.0 conda activate tf-gpu-cuda9
Nightly builds#
Advanced users may wish to install the latest nightly build of TensorFlow. These nightly builds are unstable and are only available as pip packages on PyPI.
To install the nightly build of CPU-only TensorFlow:
conda create -n tf-n python conda activate tf-n pip install tf-nightly
Or, to install the nightly build of GPU TensorFlow on Linux or Windows:
conda create -n tf-n-gpu python conda activate tf-n-gpu pip install tf-nightly-gpu
How to install TensorFlow and Keras using Anaconda Navigator — without the command line
Ekapope Viriyakovithya
Say no to pip install in the command line! Here’s an alternative way to install TensorFlow on your local machine in 3 steps.
Why am I writing this?
I played around with pip install with multiple configurations for several hours, trying to figure how to properly set my python environment for TensorFlow and Keras.
Just before I gave up, I found this…
This article will walk you through the process how to install TensorFlow and Keras by using the GUI version of Anaconda. I assume you have downloaded and installed Anaconda Navigator already.
Let’s get started!
- Launch Anaconda Navigator. Go to the Environments tab and click ‘Create’.
2. Input a new environment name — I put ‘tensorflow_env’. Make sure to select Python 3.6 here! Then ‘Create’, this may take few minutes.
3. In your new ‘tensorflow_env’ environment, select ‘Not installed’, and type in ‘tensorflow’. Then, tick ‘tensorflow’ and ‘Apply’. The pop-up window will appear, go ahead and apply. This may take several minutes.
Do the same for ‘keras’.
Check your installation by importing the packages. If everything is okay, the command will return nothing. If the installation was unsuccessful, you will get an error.
And…Ta-da! It’s done! You can follow this article to test your newly installed packages 🙂
Thank you for reading. Please give it a try, and let me know your feedback!
Consider following me on GitHub, Medium, and Twitter to get more articles and tutorials on your feed if you like what I did. 🙂