定制構建用於張量,並具有平台優化,包括SSE,AVX和FMA。如果您在庫存pip install tensorflow中看到以下消息,那麼您來對位置。
The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
or:
Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
這些輪子是用於在雲機學習平台Tinymind上使用的。如果要將它們安裝在自己的Linux框中(Ubuntu 16.04 LTS),則可以這樣做:
# RELEASE is the git tag like tf1.1-cpu. WHEEL is the full wheel name.
pip --no-cache-dir install https://github.com/mind/wheels/releases/download/{RELEASE}/{WHEEL}所有車輪的列表可以在“版本”頁面中找到。
單擊下面的鏈接跳到特定的發行版本。同樣,除非另有說明,否則它們是為Ubuntu 16.04 LT構建的。
| TF | 構建 |
|---|---|
| 1.1 | CPU,GPU |
| 1.2 | CPU,GPU(僅Python 3.6) |
| 1.2.1 | CPU,GPU |
| 1.3 | CPU,與MPI的GPU |
| 1.3.1 | CPU,CPU調試,GPU,GPU與MPI |
| 1.4 | CPU,CPU調試,CPU MACOS,GPU(CUDA 8,CUDA 9,用於計算3.7,CUDA 9,用於計算3.7/6.0/7.0,CUDA 9,通用CUDA,無MKL的CUDA 9) |
| 1.4.1 | CPU,GPU(CUDA 8,CUDA 9,CUDA 9.1) |
| 1.5 | CPU,GPU(CUDA 9,無MKL的CUDA 9,CUDA 9.1,CUDA 9.1無MKL) |
| 1.6 | CPU,GPU(CUDA 9.1,CUDA 9.1無MKL) |
| 1.7 | CPU,GPU(CUDA 9,CUDA 9.1,CUDNN 7.1) |
請注意,您的計算機需要具有相對較新的Intel CPU(如果使用GPU版本,則需要NVIDIA GPU)與下面的車輪兼容。如果硬件不是最新的,則車輪將不起作用。
Tensorflow 1.4.1及以上的車輪包含對GCP,S3和Hadoop的支持。彙編標誌包括:
--config=opt --config=cuda --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --copt=-mavx --copt=-msse4.1 --copt=-msse4.2 --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both
您很可能需要的車輪在下面列出。需要某物或輪子對您不起作用嗎?提出問題。 (不幸的是,由於我們自己沒有Windows機器,我們將無法滿足Windows車輪的要求。)
| 版本 | Python | 拱 | 關聯 |
|---|---|---|---|
| 1.1 | 2.7 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.1-cpu/tensorflow-1.1.0-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.1 | 3.5 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.1-cpu/tensorflow-1.1.0-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.1 | 3.6 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.1-cpu/tensorflow-1.1.0-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.1 | 2.7 | GPU | https://github.com/mind/wheels/releases/download/tf1.1-gpu/tensorflow-1.1.0-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.1 | 3.5 | GPU | https://github.com/mind/wheels/releases/download/tf1.1-gpu/tensorflow-1.1.0-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.1 | 3.6 | GPU | https://github.com/mind/wheels/releases/download/tf1.1-gpu/tensorflow-1.1.0-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.2 | 2.7 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.2-cpu/tensorflow-1.2.0-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.2 | 3.5 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.2-cpu/tensorflow-1.2.0-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.2 | 3.6 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.2-cpu/tensorflow-1.2.0-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.2 | 3.6 | GPU | https://github.com/mind/wheels/releases/download/tf1.2-gpu/tensorflow-1.2.0-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.2.1 | 2.7 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.2.1-cpu/tensorflow-1.2.1-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.2.1 | 3.5 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.2.1-cpu/tensorflow-1.2.1-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.2.1 | 3.6 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.2.1-cpu/tensorflow-1.2.1-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.2.1 | 2.7 | GPU | https://github.com/mind/wheels/releases/download/tf1.2.1-gpu/tensorflow-1.2.1-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.2.1 | 3.5 | GPU | https://github.com/mind/wheels/releases/download/tf1.2.1-gpu/tensorflow-1.2.1-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.2.1 | 3.6 | GPU | https://github.com/mind/wheels/releases/download/tf1.2.1-gpu/tensorflow-1.2.1-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.3 | 2.7 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.3-cpu/tensorflow-1.3.0-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.3 | 3.5 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.3-cpu/tensorflow-1.3.0-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.3 | 3.6 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.3-cpu/tensorflow-1.3.0-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.3 | 2.7 | GPU | https://github.com/mind/wheels/releases/download/tf1.3-gpu/tensorflow-1.3.0-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.3 | 3.5 | GPU | https://github.com/mind/wheels/releases/download/tf1.3-gpu/tensorflow-1.3.0-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.3 | 3.6 | GPU | https://github.com/mind/wheels/releases/download/tf1.3-gpu/tensorflow-1.3.0-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.3.1 | 2.7 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.3.1-cpu/tensorflow-1.3.1-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.3.1 | 3.5 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.3.1-cpu/tensorflow-1.3.1-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.3.1 | 3.6 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.3.1-cpu/tensorflow-1.3.1-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.3.1 | 2.7 | GPU | https://github.com/mind/wheels/releases/download/tf1.3.1-gpu/tensorflow-1.3.1-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.3.1 | 3.5 | GPU | https://github.com/mind/wheels/releases/download/tf1.3.1-gpu/tensorflow-1.3.1-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.3.1 | 3.6 | GPU | https://github.com/mind/wheels/releases/download/tf1.3.1-gpu/tensorflow-1.3.1-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.4 | 2.7 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.4-cpu/tensorflow-1.4.0-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.4 | 3.5 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.4-cpu/tensorflow-1.4.0-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.4 | 3.6 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.4-cpu/tensorflow-1.4.0-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.4 | 2.7 | GPU | https://github.com/mind/wheels/releases/download/tf1.4-gpu/tensorflow-1.4.0-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.4 | 3.5 | GPU | https://github.com/mind/wheels/releases/download/tf1.4-gpu/tensorflow-1.4.0-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.4 | 3.6 | GPU | https://github.com/mind/wheels/releases/download/tf1.4-gpu/tensorflow-1.4.0-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.4.1 | 2.7 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.4.1-cpu/tensorflow-1.4.1-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.4.1 | 3.5 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.4.1-cpu/tensorflow-1.4.1-cp35-cp35-cp35-cp35m-linux_x86_64.whl |
| 1.4.1 | 3.6 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.4.1-cpu/tensorflow-1.4.1-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.4.1 | 2.7 | GPU | https://github.com/mind/wheels/releases/download/tf1.4.1-gpu/tensorflow-1.4.1-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.4.1 | 3.5 | GPU | https://github.com/mind/wheels/releases/download/tf1.4.1-gpu/tensorflow-1.4.1-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.4.1 | 3.6 | GPU | https://github.com/mind/wheels/releases/download/tf1.4.1-gpu/tensorflow-1.4.1-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.5 | 2.7 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.5-cpu/tensorflow-1.5.0-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.5 | 3.5 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.5-cpu/tensorflow-1.5.0-cp35-cp35-cp35m-linux_x86_64.whl |
| 1.5 | 3.6 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.5-cpu/tensorflow-1.5.0-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.5 | 2.7 | GPU | https://github.com/mind/wheels/releases/download/tf1.5-gpu/tensorflow-1.5.0-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.5 | 3.5 | GPU | https://github.com/mind/wheels/releases/download/tf1.5-gpu/tensorflow-1.5.0-cp35-cp35-cp35m-linux_x86_64.whl |
| 1.5 | 3.6 | GPU | https://github.com/mind/wheels/releases/download/tf1.5-gpu/tensorflow-1.5.0-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.6 | 2.7 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.6-cpu/tensorflow-1.6.0-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.6 | 3.5 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.6-cpu/tensorflow-1.6.0-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.6 | 3.6 | 中央處理器 | https://github.com/mind/wheels/releases/download/tf1.6-cpu/tensorflow-1.6.0-cp36-cp36-cp36m-linux_x86_64.whl |
| 1.6 | 2.7 | GPU | https://github.com/mind/wheels/releases/download/tf1.6-gpu-cuda91/tensorflow-1.6.0-cp27-cp27-cp27mu-linux_x86_64.whl |
| 1.6 | 3.5 | GPU | https://github.com/mind/wheels/releases/download/tf1.6-gpu-cuda91/tensorflow-1.6.0-cp35-cp35-cp355m-linux_x86_64.whl |
| 1.6 | 3.6 | GPU | https://github.com/mind/wheels/releases/download/tf1.6-gpu-cuda91/tensorflow-1.6.0-cp36-cp36-cp36m-linux_x86_64.whl |
本節包含調試設置的提示。認真地說,嘗試tinymind,您將無需浪費時間再次調試。我們還擁有可以在自己的機器上使用的Docker圖像。如果本節沒有解決您的問題,請確保提出問題。
不同的TensorFlow版本支持/需要不同的CUDA版本:
| TF | 庫達 | 庫丁 | 計算能力 |
|---|---|---|---|
| 1.1,1.2 | 8.0 | 5.1 | 3.7(K80) |
| 1.2.1-1.3.1 | 8.0 | 6.0 | 3.7 |
| 1.4 | 8.0/9.0 | 6.0/7.0 | 3.7,6.0(P100),7.0(V100) |
| 1.4.1 | 8.0/9.0/9.1 | 6.0/7.0 | 3.7、6.0、7.0 |
| 1.5 | 9.0/9.1 | 7.0 | 3.7、6.0、7.0 |
| 1.6 | 9.1 | 7.0 | 3.7、6.0、7.0 |
| 1.7 | 9.0/9.1 | 7.0/7.1 | 3.7、6.0、7.0 |
TensorFlow <1.4與當前版本CUDA 9不起作用。您需要進行sudo apt-get install cuda sudo apt-get install cuda-8-0 。 cuda 8張曲流1.4的變體使用cudnn 6.0,cuda 9.x變體與cudnn 7.x一起使用。
# Install CUDA 8
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda-8-0
# Install CUDA 9
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda確保正確設置了與CUDA相關的環境變量:
echo ' export CUDA_HOME=/usr/local/cuda ' >> ~ /.bashrc
echo ' export PATH=$PATH:$CUDA_HOME/bin ' >> ~ /.bashrc
echo ' export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64 ' >> ~ /.bashrc
. ~ /.bashrc下載正確的cudnn並按照以下方式安裝:
# The cuDNN tar file.
tar xzvf cudnn-9.0-linux-x64-v7.0.tgz
sudo cp cuda/lib64/ * /usr/local/cuda/lib64/
sudo cp cuda/include/cudnn.h /usr/local/cuda/include/缺少libcupti圖書館?安裝並將其添加到您的PATH中。
sudo apt-get install libcupti-dev
echo ' export LD_LIBRARY_PATH=/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH ' >> ~ /.bashrc某些車輪支撐張力。要安裝Tensorrt,請首先從Nvidia的網站下載,然後運行:
sudo dpkg -i nv-tensorrt-repo-ubuntu1604-ga-cuda9.0-trt3.0.4-20180208_1-1_amd64.deb
sudo apt-get update
sudo apt-get install tensorrtMKL是英特爾的深度學習內核圖書館,它使CPU上的訓練神經網更快。如果您沒有它,請像以下內容一樣安裝它:
# If you don't have cmake
sudo apt install cmake
git clone https://github.com/01org/mkl-dnn.git
cd mkl-dnn/scripts && ./prepare_mkl.sh && cd ..
mkdir -p build && cd build && cmake .. && make
sudo make install
echo ' export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib ' >> ~ /.bashrc請注意,Ubuntu 16.04 LTS是預期的環境。如果您有舊的操作系統,則可能會遇到舊的GLIBC版本的問題。您可能需要在此處查看討論,以查看他們是否會有所幫助。
使用帶有MPI支撐的車輪?確保運行sudo apt-get install mpich 。