Last active
November 27, 2019 02:52
-
-
Save shinob/8a6c8827470833bf4a76a37f24cf821d to your computer and use it in GitHub Desktop.
Macで深層学習の環境をさくっと作る手順 with TensorFlow and OpenCV ref: https://qiita.com/mix_dvd/items/b49651cf1181a986506c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/Downloads | |
curl -LO https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz | |
tar xf pkg-config-0.29.2.tar.gz | |
cd pkg-config-0.29.2 | |
./configure --with-internal-glib | |
make && make install | |
cd ~/Downloads | |
curl -LO http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz | |
tar xf yasm-1.3.0.tar.gz | |
cd yasm-1.3.0 | |
./configure | |
make && make install | |
cd ~/Downloads | |
curl -LO http://www.ffmpegmac.net/resources/ffmpeg-3.3.1.tar.bz2 | |
tar xf ffmpeg-3.3.1.tar.bz2 | |
cd ffmpeg-3.3.1 | |
./configure | |
make && make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/Downloads | |
curl -LO https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz | |
tar xf pkg-config-0.29.2.tar.gz | |
cd pkg-config-0.29.2 | |
./configure --with-internal-glib | |
make && make install | |
cd ~/Downloads | |
curl -LO http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz | |
tar xf yasm-1.3.0.tar.gz | |
cd yasm-1.3.0 | |
./configure | |
make && make install | |
cd ~/Downloads | |
curl -LO http://www.ffmpegmac.net/resources/ffmpeg-3.3.1.tar.bz2 | |
tar xf ffmpeg-3.3.1.tar.bz2 | |
cd ffmpeg-3.3.1 | |
./configure | |
make && make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conda install py-xgboost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python | |
Python 3.6.0 |Anaconda 4.3.1 (x86_64)| (default, Dec 23 2016, 13:19:00) | |
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import cv2 | |
>>> import tensorflow as tf | |
>>> exit() | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c.NotebookApp.browser = u'/usr/bin/open -a Safari %s' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo sh tools_installer.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo sh tools_installer.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo sh ffmpeg_installer.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo sh ffmpeg_installer.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo sh opencv_installer.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo sh opencv_installer.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pip install tensorflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv | |
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
echo 'export RBENV_ROOT="$HOME/.rbenv"' >> ~/.bashrc | |
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
source ~/.bashrc | |
rbenv install 2.4.1 | |
rbenv rehash | |
rbenv global 2.4.1 | |
gem install rbczmq | |
gem install iruby | |
gem install erector | |
iruby notebook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/Downloads | |
unzip IPAfont00303.zip | |
mv IPAfont00303/*.ttf ~/.pyenv/versions/anaconda3-4.3.1/lib/python3.6/site-packages/matplotlib/mpl-data/fonts/ttf/ | |
jupyter notebook --generate-config | |
echo "c.NotebookApp.notebook_dir = u'notebook'" >> ~/.jupyter/jupyter_notebook_config.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/Downloads | |
git clone https://github.com/Itseez/opencv.git opencv | |
git clone https://github.com/Itseez/opencv_contrib.git opencv_contrib | |
cd opencv | |
mkdir build | |
cd build | |
cmake -D CMAKE_BUILD_TYPE=RELEASE \ | |
-D BUILD_SHARED_LIBS=OFF \ | |
-D CMAKE_INSTALL_PREFIX=/usr/local \ | |
-D FFMPEG=ON \ | |
-D PYTHON3_EXECUTABLE=/Users/[username]/.pyenv/versions/anaconda3-4.3.1/bin/python \ | |
-D PYTHON3_INCLUDE_DIR=/Users/[username]/.pyenv/versions/anaconda3-4.3.1/include/python3.6m \ | |
-D PYTHON3_LIBRARY=/Users/[username]/.pyenv/versions/anaconda3-4.3.1/lib/libpython3.6m.dylib \ | |
-D PYTHON3_NUMPY_INCLUDE_DIRS=/Users/[username]/.pyenv/versions/anaconda3-4.3.1/lib/python3.6/site-packages/numpy/core/include \ | |
-D PYTHON3_PACKAGES_PATH=/Users/[username]/.pyenv/versions/anaconda3-4.3.1/lib/python3.6/site-packages \ | |
-D INSTALL_C_EXAMPLES=OFF \ | |
-D INSTALL_PYTHON_EXAMPLES=ON \ | |
-D BUILD_EXAMPLES=ON \ | |
-D BUILD_opencv_python3=ON \ | |
-D OPENCV_EXTRA_MODULES_PATH=~/Downloads/opencv_contrib/modules \ | |
.. | |
make -j4 | |
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/yyuu/pyenv.git ~/.pyenv | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc | |
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(pyenv init -)"' >> ~/.bashrc | |
echo 'if [ -f ~/.bashrc ] ; then' >> ~/.bash_profile | |
echo '. ~/.bashrc' >> ~/.bash_profile | |
echo 'fi' >> ~/.bash_profile | |
source ~/.bashrc | |
pyenv install anaconda3-4.3.1 | |
pyenv rehash | |
pyenv global anaconda3-4.3.1 | |
echo 'export PATH="$PYENV_ROOT/versions/anaconda3-4.3.1/bin/:$PATH"' >> ~/.bashrc | |
source ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/Downloads | |
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz | |
tar xzf autoconf-latest.tar.gz | |
cd autoconf-* | |
./configure --prefix=/usr/local | |
make && sudo make install | |
cd ~/Downloads | |
curl -fL http://ftpmirror.gnu.org/automake/automake-1.15.tar.gz | tar xzf - | |
cd automake-* | |
./configure --prefix=/usr/local | |
make && make install | |
cd ~/Downloads | |
curl -fL http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz | tar xzf - | |
cd libtool-* | |
./configure --prefix=/usr/local | |
make && make install | |
cd ~/Downloads | |
curl -OL https://cmake.org/files/v3.8/cmake-3.8.1-Darwin-x86_64.tar.gz | |
tar xzf cmake-3.8.1-Darwin-x86_64.tar.gz | |
cd came-* | |
cp CMake.app /Applications/ | |
ln -s "/Applications/CMake.app/Contents/bin/ccmake" /usr/local/bin/ccmake | |
ln -s "/Applications/CMake.app/Contents/bin/cmake" /usr/local/bin/cmake | |
ln -s "/Applications/CMake.app/Contents/bin/cmake-gui" /usr/local/bin/cmake-gui | |
ln -s "/Applications/CMake.app/Contents/bin/cmakexbuild" /usr/local/bin/cmakexbuild | |
ln -s "/Applications/CMake.app/Contents/bin/cpack" /usr/local/bin/cpack | |
ln -s "/Applications/CMake.app/Contents/bin/ctest" /usr/local/bin/ctest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/Downloads | |
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz | |
tar xzf autoconf-latest.tar.gz | |
cd autoconf-* | |
./configure --prefix=/usr/local | |
make && sudo make install | |
cd ~/Downloads | |
curl -fL http://ftpmirror.gnu.org/automake/automake-1.15.tar.gz | tar xzf - | |
cd automake-* | |
./configure --prefix=/usr/local | |
make && sudo make install | |
cd ~/Downloads | |
curl -fL http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz | tar xzf - | |
cd libtool-* | |
./configure --prefix=/usr/local | |
make && sudo make install | |
cd ~/Downloads | |
curl -OL https://cmake.org/files/v3.8/cmake-3.8.1-Darwin-x86_64.tar.gz | |
tar xzf cmake-3.8.1-Darwin-x86_64.tar.gz | |
cd cmame-* | |
cp CMake.app /Applications/ | |
ln -s "/Applications/CMake.app/Contents/bin/ccmake" /usr/local/bin/ccmake | |
ln -s "/Applications/CMake.app/Contents/bin/cmake" /usr/local/bin/cmake | |
ln -s "/Applications/CMake.app/Contents/bin/cmake-gui" /usr/local/bin/cmake-gui | |
ln -s "/Applications/CMake.app/Contents/bin/cmakexbuild" /usr/local/bin/cmakexbuild | |
ln -s "/Applications/CMake.app/Contents/bin/cpack" /usr/local/bin/cpack | |
ln -s "/Applications/CMake.app/Contents/bin/ctest" /usr/local/bin/ctest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment