Introduction
As a data science learner, many resources are easily accessed either on a paid or temporary basis. At times, this is ideal. While cloud technologies are helpful throughout a workplace setting, this may not be a continuous learning platform for everyone. Recognizing learners are usually working with other devices, would make a difference on learning resources while providing effective learning equally.
In this article, the original backbone of all modern computational languages will be discussed. The language that started it all was C and its variations such as C++ and C#.
Through a realistic perspective regarding deprecation and resources that are no longer supported, the current procedure to reach results will be displayed in this tutorial.
While there are several resourceful machine learning tools, TensorFlow will be discussed.
Prerequisites:
- Windows Microsoft device (the tutorial uses Windows Microsoft Professional 10).
- Root and Sudo permissions (the tutorial uses ROOT)
- Kali Linux (Click here for the full procedure).
- Some prior knowledge in Java or C.
- Knowledge of package installations.
- Prior knowledge of Tensorflow and Tensorflow Lite or willingness to learn Tensorflow.
- Internet access (for installations and access to servers).
Once the prerequisites are generally met, let’s begin.
Kali Linux
Kali Linux was chosen for its Graphical User Interface (GUI) capabilities as an emulator. Compatible Linux alternatives for Microsoft can be found from the Microsoft Store, however, most applications will produce error warnings.
Most Win-KeX (Kex) instructions are mentioned on kali.org.
A few additional installations are needed to generate the Kex GUI window.
The line below is the missing package needed.
apt install dbus-x11
As a note, upgrading packages may cause Kex to become dysfunctional. This is also a time to reinstall Kali Linux.
Once Win-KeX is functional and visible. The screen should appear similar to the image below.
The taskbar usually should contain the image below. Similar to an eye of a tiger, hence vnc – tigervnc.
There have been many great introductory tutorials published on Analytics Vidhya. Click here to take a look to learn or to refresh memory.
In this tutorial, Tensorflow will be the machine learning package to analyze.
After the essential packages and dependencies (examples can include boost, cmake, opencv) have been installed without conflicts, TensorFlow can be installed.
apt install cmake apt install git #If not already installed. git clone
However, for a comfortable installation of Tensorflow, the most time-efficient and long-lasting method is to download the .tar version of Tensorflow.
The procedures are included on the website and can be found here.
To prove that this version is functional and working during 2021, the following images and lines of codes below are provided.
This is a basic version of “Hello, World” to test if the installation works.
Download the tar file from tensorflow.org with the following:
wget https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.4.0.tar.gz
Extract to the appropriate path directory and configure.
tar -C /usr/local -xzf libtensorflow-cpu-linux-x86_64-2.4.0.tar.gz
ldconfig
Sudo in Root mode may not make a difference, however, it might become an issue as another mode.
To check the above line worked, the next step is to look under the /usr/local path directory.
The images above can reinforce that the extraction worked.
To test the C version of the Tensorflow library, more information can be found here.
Nano allows the creation of C scripts. The lines below can demonstrate the procedure clearer.
nnano hellotf.c #include <stdio.h> #include <tensorflow/c/c_api.h> int main() { printf("This message was for Analytics Vidhya Blogathon 7. TensoFlow version: %s was used.", TF_Version()); return 0; }
Save and exit. The next step is to build, compile, and run in C.
Enter the following:
gcc hellotf.c -ltensorflow -o hellotf
./hellotf
The result will appear similar to the image below.
As shown above, the message could be displayed. This means TensorFlow C API is working and functional.
Conclusion:
Choosing C allows a direct workable version of Tensorflow. By using C, upgrades, and changes to a package is less likely. While the provided example was purely a basic demo, it still opens up further opportunities with TensorFlow.
Takeaways:
- C packages are functional and may produce similar results compared to other computer languages.
- Learning C is beneficial to effectively learn the core essentials to backend builds usually used in other languages.
- Types of devices can become compatible using a platform that provides commonalities. For example, a Microsoft Windows device can emulate a Linux terminal with Kali Linux.
The media shown in this article are not owned by Analytics Vidhya and is used at the Author’s discretion.