The first one, two, three solved the problem of feature extraction, and then it was the classifier's turn. Here I plan to try keras to call cnn to classify some song data. After the sample question is mentioned, here mainly needs to build an anaconda + tensorflow + keras deep learning environment.
Anaconda does not need to mention that it is standard, generally there will be, installation is very simple, skip. The installation of tensorflow is generally divided into pip installation and conda installation. Pip installation is not recommended. Although it is very convenient, I including many people on the Internet have problems when using pip installation. It is not difficult to install conda, that is, the download speed of foreign sources is very slow, and domestic sources need to be replaced (Tsinghua sources have heard that there is also a problem, and other than Tsinghua).
1. Change source
conda install tensorflow
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
conda config --set show_channel_urls yes
2. Create a conda virtual environment
conda create -n tensorflow2_0 python=3.6
After installation, you can use the command to view
conda info --envs
3. Activate the new environment
activate tensorflow2_0
4. Install tensorflow \ keras
conda install tensorflow
conda install keras
Test it, open jupyter,
import tensorflow
import keras
Yes, the installation was successful.
5. Run an example
Use the famous mnist for hello world.
There is a problem with the native example directly, the dataset download is too slow.
It is best to download the data from the mirror first and then modify the data import method. This article provides detailed methods and codes that can be run after testing.
[Keras] Solve the problem that the MNIST dataset cannot be downloaded in the example case