Gatys風格遷移NeuralImageSynthesis(慢速)環境搭建

@[TOC](Gatys風格遷移NeuralImageSynthesis ( 慢速 )環境搭建)

環境總覽

源碼地址:NeuralImageSynthesis
注意:這個代碼的環境必須要在ubuntu 16.04上裝,並且gcc以及g++要求5.4版本,ubuntu18.04不能安裝cuda8.0,安裝其他環境也是各種問題。如果是低於ubuntu16.04的系統,我沒有試過不是很清楚,但是ubuntu16.04的系統的安裝,親測可用~

這裏是需要安裝的環境以及準備總覽:

  1. gcc-5g++-5
  2. cuda 8.0
  3. cudnn 5
  4. torch7
  5. jupyter notebook
  6. lua 的loadcaffe模塊
  7. lua的hdf5模塊

gcc、g++版本確認

luarocks install hdf5

cuda以及cudnn安裝

請參考我之前的博客:cuda以及cudnn安裝,可能會遇到的各種錯誤在這篇博客中也有解決方案,博客中也有顯卡驅動的安裝方法(如果沒有安裝的話)。

torch7

參考官網
運行下面3個命令

git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh

第一個命令會下載很多東西,大概10~20個包,如果速度過慢,建議換源
第2行命令會提示torch7的依賴項已被全部安裝,最後一行命令運行成功的標誌是問你是否添加環境路徑,輸入yes即可。

source ~/.bashrc

最後輸入以上命令重新運行環境變量,退出終端重進,輸入th看是否安裝成功。

jupyter notebook 安裝

參考官網

sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install jupyter

lua 的loadcaffe模塊

參考loadcaffe模塊

sudo apt-get install libprotobuf-dev protobuf-compiler
luarocks install loadcaffe

luarocks是lua語言的包管理器。使用該命令會非常慢,請耐心等待。

插入鏈接與圖片

參考hdf5模塊 報錯
以及hdf5模塊

apt-get install libhdf5-serial-dev
luarocks install hdf5

[ubuntu系統中import h5py, ImportError: No module named h5py的解決方法]

其他可能需要的模塊

(https://blog.csdn.net/jiandanjinxin/article/details/52065039)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章