Tips for using python + caffe with TSUBAME

The other day, there was a person who made caffe available on TSUBAME. (reference: https://twitter.com/sacred_fox/status/605297481765691392 https://twitter.com/sacred_fox/status/605297652331212800 http://tsubame.gsic.titech.ac.jp/labs)

When using with python, basically

~> source /usr/apps.sp3/nosupport/gsic/env/caffe-0.11.0.sh

Then import caffe.

With this script /usr/apps.sp3/nosupport/gsic/python/2.7.7/bin/ It will run the included python. However, if you have python installed in addition to the standard python because the version of python that is included in TSUBAME as standard is old and you want to use it, copy this script to an appropriate location and copy it as follows. Some comments are made out and used.


# Caffe: 0.11.0
# CUDA: 6.5
# HDF: 1.8.11
# Python: 2.7.8
# Boost: 1.58.0

source /usr/apps.sp3/env/set_cuda-6.5.sh
source /usr/apps.sp3/nosupport/gsic/env/all/opencv-3.0.0-rc1.sh
source /usr/apps.sp3/nosupport/gsic/env/all/boost-1.58.0.sh
#source /usr/apps.sp3/nosupport/gsic/env/all/python-2.7.7.sh
export PATH=/usr/apps.sp3/nosupport/gsic/caffe/0.11.0/bin/:$PATH
export LD_LIBRARY_PATH=/usr/apps.sp3/nosupport/gsic/caffe/0.11.0/lib/:/usr/apps.sp3/nosupport/hdf5/1.8.11/lib/:$LD_LIBRARY_PATH
export PYTHONPATH=/usr/apps.sp3/nosupport/gsic/caffe/0.11.0/python/:$PYTHONPATH
export CPATH=/usr/apps.sp3/nosupport/gsic/caffe/0.11.0/include/:/usr/apps.sp3/cuda/6.5/include/:/usr/apps.sp3/isv/intel/xe2013.1.046/mkl/include/:/usr/apps.sp3/nosupport/hdf5/1.8.11/include/:$CPATH
export LIBRARY_PATH=/usr/apps.sp3/nosupport/gsic/caffe/0.11.0/lib/:/usr/apps.sp3/nosupport/hdf5/1.8.11/lib/:$LIBRARY_PATH

In this case, of course, it will not work unless you install caffe's dependent library in your python environment. The dependencies are as described on the official caffe page (http://caffe.berkeleyvision.org/), and many can be installed with pip. However, since only protobuf cannot be installed with pip, it is necessary to drop the source code from the official and execute the following command in the installed directory.

~> ./configure
~> make
~> make install
~> cd python
~> python setup.py build
~> python setup.py test
~> python setup.py install

Recommended Posts

Tips for using python + caffe with TSUBAME
[TouchDesigner] Tips for for statements using python
Tips for dealing with binaries in Python
~ Tips for Python beginners from Pythonista with love ① ~
~ Tips for Python beginners from Pythonista with love ② ~
Using Quaternion with Python ~ numpy-quaternion ~
[Python] Using OpenCV with Python (Basic)
Tips for speeding up python code correctly with numba
[Tips] Handle Athena with Python
[Python + Selenium] Tips for scraping
~ Tips for beginners to Python ③ ~
Using OpenCV with Python @Mac
Send using Python with Gmail
Tips for developing apps with Azure Cosmos DB in Python
This and that for using Step Functions with CDK + Python
Complement python with emacs using company-jedi
Harmonic mean with Python Harmonic mean (using SciPy)
Using Rstan from Python with PypeR
[Python] Using OpenCV with Python (Image transformation)
Tips for running Go with docker
[Python] Using OpenCV with Python (Edge Detection)
Getting Started with Python for PHPer-Classes
Tips for calling Python from C
Notes on using rstrip with python.
[Python] Reasons for overriding using super ()
[Python] Multiplication table using for statement
Getting Started with Python for PHPer-Functions
When using MeCab with virtualenv python
Precautions when using six with Python 2.5
[VS Code] ~ Tips when using python ~
python tips
python tips
Python Tips
Python tips
Notes for using OpenCV on Windows10 Python 3.8.3.
[AWS] Using ini files with Lambda [Python]
Easy keyword extraction with TermExtract for Python
INSERT into MySQL with Python [For beginners]
WEB scraping with Python (for personal notes)
Python development environment for macOS using venv 2016
Try mathematical formulas using Σ with python
Manually ssh registration for coreserver with python
Use DeepL with python (for dissertation translation)
Memo to ask for KPI with python
Amplify images for machine learning with python
Behind the flyer: Using Docker with Python
[50 counts] Key transmission using Python for Windows
Using Python and MeCab with Azure Databricks
[python, multiprocessing] Behavior for exceptions when using multiprocessing
Try using Python with Google Cloud Functions
Working with OpenStack using the Python SDK
[Shakyo] Encounter with Python for machine learning
Process multiple lists with for in Python
Tips for plotting multiple lines with pandas
Getting Started with Python for PHPer-Super Basics
Debug for mysql connection with python mysql.connector
[Python] Read images with OpenCV (for beginners)
Notes for using python (pydev) in eclipse
WebApi creation with Python (CRUD creation) For beginners
Tips for making small tools in python
I'm using tox and Python 3.3 with Travis-CI