[PYTHON] A story about how theano was moved with TSUBAME 2.0

abstract It is a record until theano is run on TSUBAME 2.0.

In TSUBAME 2.0, you need to build all python related items by yourself. I installed numpy, scipy, theano by referring to this site, but scipy.test () failed. And theano didn't work either.

2016/7/25 postscript It seems that this site has disappeared, so postscript. First, register the public key on the portal. Set ssh with

~/.ssh/config


Host login-t2.g.gsic.titech.ac.jp                                            
    HostName login-t2.g.gsic.titech.ac.jp                                      
    User USER_ID                                                              
    IdentityFile WHERE_OF_PUBLIC_KEY                                                 
    RemoteForward 3128 proxy.noc.titech.ac.jp:3128

On the TSUBAME side,

~/.bashrc


export http_proxy="http://localhost:3128"                                      
export https_proxy="http://localhost:3128"                                     
export ftp_proxy="http://localhost:3128"

End of postscript

As a result of trial and error, installing numpy using OpenBLAS forced theano to work properly.

[Mutism]

[Demerit]

First, go to 3.4 (install matplotlib) on the above site.

OpenBLAS

cd OpenBLAS
make BINARY=64 USE_THREAD=1 FC=gfortran
make PREFIX=~/.local/OpenBLAS/ install 

Put it in the PATH

export LIBRARY_PATH=~/.local/lib:~/.local/OpenBLAS/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=~/.local/lib:~/.local/OpenBLAS/lib:$LD_LIBRARY_PATH
export PATH=~/.local/bin:~/.local/OpenBLAS/bin:$PATH
export BLAS=/home/....../.local/OpenBLAS/lib/libopenblas.a
export LAPACK=/home/....../.local/OpenBLAS/lib/libopenblas.a

numpy

cd numpy
cp site.cfg.example site.cfg

Here, and [here](http://osdf.github.io/blog/numpyscipy-with-openblas- For-ubuntu-1204-second-try.html), write site.cfg as follows (Hereafter, please rewrite PATH as appropriate)

site.cfg


[default]
library_dirs = /home/....../.local/OpenBLAS/lib

[openblas]
libraries = openblas
library_dirs = /home/....../.local/OpenBLAS/lib
include_dirs = /home/....../.local/OpenBLAS/include

[atlas]
atlas_libs = openblas
library_dirs = /home/....../.local/OpenBLAS/lib

[lapack]
lapack_libs = openblas
library_dirs = /home/....../.local/OpenBLAS/lib

Somehow, if you don't set atlas and lapack, segfault will occur when testing the dot () function with scipy.

Check if it was set properly

python setup.py config

If openblas, atlas, lapack are displayed as FOUND, move on to installation

python setup.py build
python setup.py install
cd ~
python -c "import numpy;numpy.test(verbose=10)"

scipy There seems to be no need to do anything about scipy

cd scipy
python setup.py build
python setup.py install
cd ~
python -c "import scipy;scipy.test(verbose=10)"

Theano

cd theano
python setup.py develop --prefix=~/.local
python setup.py install

Create ~ / .theanorc as follows

.theanorc


[global]
floatX = float32
device = gpu
openmp = True


[nvcc]
fastmath = True

[blas]
ldflags =  -lopenblas

[cuda]
root = /usr/apps.sp3/cuda/6.0/
[gcc]
cxxflags = -I/usr/apps.sp3/mpi/openmpi/1.8.2/g4.3.4_cuda6.0/include -I/usr/apps.sp3/mpi/openmpi/1.8.2/g4.3.4_cuda6.0/include/openmpi -L/usr/apps.sp3/mpi/openmpi/1.8.2/g4.3.4_cuda6.0/lib -lmpi -lmpi_cxx

Then run your favorite program. If the sample of Deep Learning Tutorials works, I wonder if it can be managed. ..

Recommended Posts

A story about how theano was moved with TSUBAME 2.0
A story about how to deal with the CORS problem
A story about machine learning with Kyasuket
A story about implementing a login screen with django
A story about making 3D space recognition with Python
A story about using Resona's software token with 1Password
A story about predicting exchange rates with Deep Learning
A story about making Hanon-like sheet music with Python
A story about trying a (Golang +) Python monorepo with Bazel
A story about how Windows 10 users created an environment to use OpenCV3 with Python 3.5
How to cast with Theano
A story about how to specify a relative path in python.
A story about competing with a friend in Othello AI Preparation
A story about installing matplotlib using pip with an error
A story about an amateur making a breakout with python (kivy) ②
A story about an amateur making a breakout with python (kivy) ①
A story about making a tanka by chance with Sudachi Py
A story about a python beginner stuck with No module named'http.server'
A refreshing story about Python's Slice
A story about adding a REST API to a daemon made with Python
A sloppy story about Python's Slice
A story about developing a soft type with Firestore + Python + OpenAPI + Typescript
A story about using Python's reduce
[Small story] How to save matplotlib graphs in a batch with Jupyter
Think about how to write a filter with the Shotgun API-Contact Versions
How about creating a virtual environment with Anaconda and doing pip install?
A story about automating online mahjong (Mahjong Soul) with OpenCV and machine learning
A story I was addicted to trying to get a video url with tweepy
A story about remodeling Lubuntu into a Chromebook
How to add a package with PyCharm
A story about Python pop and append
A story about a 503 error on Heroku open
How about polarity analysis with "order" added?
A story about a programming beginner who made a business efficiency map application with GeoDjango
[Note] A story about not being able to break through a proxy with pip
A story about building an IDE environment with WinPython on an old Windows OS.
A story about making an x86 bootloader that can boot vmlinux with Rust
A story that I was addicted to when I made SFTP communication with python
How to share a virtual environment [About requirements.txt]
A story about simple machine learning using TensorFlow
How to send a message to LINE with curl
How to draw a 2-axis graph with pyplot
How to develop a cart app with Django
How to make a dictionary with a hierarchical structure.
A story about operating a GCP instance from Discord
A story about Go's global variables and scope
A story stuck with handling Python binary data
A story about displaying article-linked ads on Jubatus
A story about running Python on PHP on Heroku
A story packed with absolute values in numpy.ndarray
How to create a multi-platform app with kivy
A note about checking modifiers with Max Plus
A story about modifying Python and adding functions
A story about data analysis by machine learning
Two things I was happy about with Python 3.9
A less likely misunderstanding about how to specify a handler for a zip uploaded with Lambda
A story about an error when loading a TensorFlow model created with Google Colab locally