/male

MAchine LEarning (MALE)

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

male: MAchine LEarning

Step 1: Clone male

  • First, clone base repository using git with HTTPS URL (recommended):
git clone https://github.com/dascimal-org/base.git

or using git via SSH if prefer:

git clone git@github.com:dascimal-org/base.git
  • When finish, you will have base directory which includes male and tests directories together with other config files. Just for convinience, rename base directory to male directory (keep note the address of this male directory for Step 2):
mv base male

Important: Do not use python setup.py install at the moment.

Step 2: Download and install Anaconda 3

  • Link: https://www.anaconda.com/download/. In Linux:
bash Anaconda3-5.0.1-Linux-x86_64.sh

For Windows, it's an executable file. So just run it and follow installation steps.

  • Don't worry about Python version. You can create Conda environment for any Python version later.
  • To use conda command in terminal, you must add Anaconda directory to $PATH environment variable. It can be selected in installation step or by:
export PATH="$HOME/anaconda3/bin:$PATH" #$HOME/anaconda3/bin is Anaconda directory

In Windows, it's better to use Anaconda Prompt. You can add it to $PATH if you still insist:

SET PATH=%PATH%;C:\ProgramData\Anaconda3
  • Update Anaconda:
conda update conda
conda update anaconda
  • Install some important libraries:
conda install pytest dill scipy scikit-learn matplotlib pillow pandas networkx

Important: Try to avoid using pip (use conda if possible)

  • To import male in Python, you must add male directory (in step 1) to $PYTHONPATH
export PYTHONPATH="$PYTHONPATH:$HOME/male" #Linux
SET PYTHONPATH=%PYTHONPATH%;C:\Users\[username]\male #Windows

You can try import male in Python to see the result.

Step 3: Install Tensorflow

  • The most flexible way to install Tensorflow is installing under created Conda environment. You can find yourself other ways in https://www.tensorflow.org/install/. These following steps are for Conda environment way.
  • First, create Conda environment (Tensorflow only supports Python version 3.5.x and 3.6.x in Windows)
conda create -n tensorflow36 python=3.6 #Name: tensorflow36, Python version: 3.6
  • Then, activate this environment (each time you'd like to use Tensorflow)
activate tensorflow36 #Windows
source activate tensorflow36 #Linux
#pip install --ignore-installed --upgrade tfBinaryURL
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.2.1-cp36-cp36m-linux_x86_64.whl #example of tensorflow 1.2.1 for Python 3.6 GPU

For Windows, use these commands:

pip install --ignore-installed --upgrade tensorflow  #CPU version
pip install --ignore-installed --upgrade tensorflow-gpu #GPU version

You can try import tensorflow in Python to see the result.

Step 4: Test male

  • cd to male/tests directory (in step 1) and run this command:
pytest

Note for GPU version of Tensorflow

  • If you install GPU version of Tensorflow, you can get the error about missing some CUDA libraries. For example: missing libcudart.so.8.0.
  • To solve this, locate if you have this missing library in your machine.
locate libcudart.so.8.0 #Example output: /usr/local/cuda-8.0/lib64/libcudart.so.8.0
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64" #add this directory to LD_LIBRARY_PATH)

If not, try install CUDA from NVIDIA first.