Installing machine learning packages on Ubuntu os based on ARM processor 32 bit

707 views Asked by At

The goal is to run support vector machine classifier code based on pandas and sklearn packages on ARM 32 bit processor of FPGA SoC (DE-10 standard Altera) with Linux LXDE Desktop (kernel 4.5). Updated the python version to 3.7.9 and pip to 20.2.4 but cannot install miniconda and anaconda. "cannot execute binary file: Exec format error" Installing numpy (and pandas, scipy) give errors " Could not build wheels for numpy which use PEP 517 and cannot be installed directly" and they need the mkl and blis libraries. The mkl library is downloaded from intel. Running "bash install.sh" gives error "The IA-32 architecture host installation is no longer supported. The product cannot be installed on the system." How can the sklearn and pandas code run on this system? Is there an easier way? How to install the mkl library?

1

There are 1 answers

0
Salma El-Sokkary On BEST ANSWER

The goal is to make a Support Vector Machine classifier run on a 32 bit ARM processor of an FPGA SoC.

To do so, you need to install some python packages like sklearn for the classifier and pandas for dataset manipulation. With a limited memory of such system, and without having pre-compiled wheels for the architecture, and with the absence of Anaconda and Miniconda due to this specific architecture, there is a challenge.

First of all boot the image of Linux LXDE Desktop (Kernel 4.5) from terasic.com on a SD card. When the image is booted, put the SD card in the FPGA SoC.

Before installing the desired packages there are some libraries and packages that they depend on. Knowing the dependencies clearly and what your system has can save you hours of errors in packages installation process, starting from building wheels of the packages. The process will focus on installing with the minimum memory. First update the system and remove any unnecessary program or package. Follow these steps:

Step1: (optional) Remove python 2.7 from the system to empty some space.

sudo apt-get remove python2.7

Step2: Clean and update using the following commands:

sudo apt clean

sudo apt update

sudo apt dist-upgrade

Step3: Install and upgrade the pip package that will be used for installing other packages using the following commands:

sudo apt-get install python3-pip

python3 -m pip install — user — upgrade pip

Step4: Install basic libraries and packages needed to build the wheels of the machine learning packages using the following commands:

sudo apt-get install libbliss-dev clang libffi-dev libssl-dev libblas-dev liblapack-dev libatlas-base-dev cython

sudo python3 -m pip install pyparsing==2.4.6

sudo python3 -m pip install pyparser==1.0

Step5: (optional) Remove firefox to empty some space and then install it again after finishing your installations via these commands:

To check the space: df -h

To remove firefox: sudo apt-get autoremove — purge firefox

To install it back after finishing everything: sudo apt-get install firefox

Step6: In our case we are installing sklearn which depends on numpy and scipy packages and installing pandas which depends on numpy package. To install the needed versions of numpy and scipy packages, install sklearn directly and it will build the wheels for the required packages, the command will fail in building scikit-learn though because numpy and scipy were not installed before the command. But when it fails, it will have installed numpy and scipy but not scikit-learn (sklearn). Type it again now it will install scikit-learn successfully. Then, install pandas it will work as numpy is now installed by sklearn, using the following commands:

To install sklearn dependencies: python3 -m pip install sklearn

To install sklearn: python3 -m pip install sklearn

To install pandas: python3 -m pip install pandas

Step7: Type python3 in terminal and now you can successfully:

import numpy

import scipy

import pandas

import sklearn