按官网文档下载安装1。
打开命令行终端
Anaconda Powershell Prompt
,并输入以下代码:
conda create -n dl01s tensorflow-gpu keras-gpu
# 如果是Windows系统,则需要指定一个python的早期版本,因为cudatoolkit cudnn可能不兼容:
# conda create -n dl01s python=3.6 tensorflow-gpu keras-gpu
# 如果在一台没有GPU的电脑上,输入:
# conda create -n dl01s tensorflow keras
conda activate dl01s
conda install -c conda-forge matplotlib opencv jupyterlab jupyter
python -c 'import keras; print(keras.__version__)'
python -c 'from tensorflow.python.client import device_lib; print(device_lib.list_local_devices())'
从官网2下载graphviz
并安装,安装时选择将程序添加到系统路径。
继续在 Anaconda
命令行输入如下代码:
conda install -c conda-forge pydot
在 Anaconda
命令行输入如下代码:
conda install -c conda-forge sklearn pandas seaborn
conda install -c conda-forge lightgbm mlxtend xgboost
首先打开 JupyterLab
:
cd code-data
jupyter lab
程序会自动跳转到默认浏览器。 新建一個命令行来测试是否成功:
in JupyterLab:
``` import keras
keras.__version__
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
Anaconda
or
Miniconda
, and tensorflow-gpu
in an
Environment.In Google Drive interface:
New -> More -> Connect more apps
, then search
colaboratory. Then create a new colab document:
New -> More -> Google Colaboratory
.
See some welcome introduction here7.
Then you are ready to go:
!pip install tensorflow
import tensorflow as tf
print(tf.__version__)
If you want to use the GPU/TPU, click
Runtime -> Change runtime type
!pip install tensorflow-gpu
Try some examples from the official site here8.
Or, the TensorFlow Hub
lets you search and discover
hundreds of trained, ready-to-deploy machine learning models in one
place. See here9.
Try Colab Pro for $9.99/month. Rich people trade money for efficiency.
OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized
Solution:
conda install nomkl
https://docs.anaconda.com/anaconda/install↩︎
https://graphviz.org/download↩︎
https://developer.nvidia.com/cuda-gpus↩︎
https://developer.nvidia.com/cuda-downloads↩︎
https://developer.nvidia.com/cudnn↩︎
https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#install-windows↩︎
https://colab.research.google.com/notebooks/welcome.ipynb↩︎
https://keras.io/examples↩︎
https://tfhub.dev↩︎