Awesome
<p align="center"> <h1 align="center">TensorFlow for VAST Platform (VA Smalltalk)</h1> <p align="center"> This is a TensorFlow wrapper for VA Smalltalk <!--- <br> <a href="docs/"><strong>Explore the docs »</strong></a> <br> --> <br> <a href="https://github.com/vasmalltalk/tensorflow-vast/issues/new?labels=Type%3A+Defect">Report a defect</a> | <a href="https://github.com/vasmalltalk/tensorflow-vast/issues/new?labels=Type%3A+Feature">Request feature</a> </p> </p>TensorFlow is a Google open source machine learning library for research and production. And this is a wrapper to be used from a higher level language like VA Smalltalk.
License
- The code is licensed under MIT.
- The documentation is licensed under CC BY-SA 4.0.
Supported platforms and versions
Currently we tested this wrapper on Linux and Windows, both on x86 and x64. In addition, we tested on ARM (Raspberry Pi 3B+ and Raspbian Buster), ARM64 (Rock64 and Armbian Buster) and ARM64 with GPU support (Nvidia Jetson Nano).
VA Smalltalk needed version is 9.2.2 or above and we have only tested on TensorFlow versions 1.13.x and 1.14.x.
Installation
- Download the 9.2.2 from Instantiations. If any of the following steps cannot be achieved, it might be due to last minute changes in the TensorFlow configuration maps and/or improvements on the VAST VM or the base library. Please contact us for an up-to-date download.
- Install TensorFlow for C for your operating system (download one of the tested versions).
- For Windows installations, make sure Microsoft Visual C++ Redistributable for Visual Studio 2017 is installed. If you still have troubles trying to load TensorFlow lib in VAST, read this and this blog post to help debugging the situation.
- Ensure tensorflow shared library (
.so
or.dll
) is findable by OS lookup procedure or reference full path in VAST ini file. - Add
TENSORFLOW_LIB
key/value under[PlatformLibrary Name Mappings]
section inabt.ini
file. Some examples:
TENSORFLOW_LIB=tensorflow
TENSORFLOW_LIB=/usr/local/lib/libtensorflow_framework.so.1.14.0
TENSORFLOW_LIB=/home/mpeck/Instantiations/TensorFlow/libtensorflow-cpu-linux-x86_64-1.14.0/lib/libtensorflow.so.1.14.0
TENSORFLOW_LIB=c:\Users\mpeck\Documents\Instantiations\tensorflow.dll
TENSORFLOW_LIB=z:\Instantiations\TensorFlow\libtensorflow-cpu-windows-x86_64-1.13.1\lib\tensorflow.dll
- Install Tonel support in your development image following this guide.
- Clone this repository.
- The easiest and recommended approach is to install TensorFlow for VASAT is via a script:
| loader path |
path := (CfsPath named: '<insert path to root tensorflow-vast local repo here>').
loader := TonelLoader readFromPath: path.
loader
beUnattended; "do not prompt and use all defaults"
useGitVersion.
loader loadAllMapsWithRequiredMaps.
Or you can load the Configuration Map TensorFlow
from the context menu of the Configuration Maps Browser: "Import"
-> "Load Configuration Maps from Tonel repository..."
-> select path to root tensorflow-vast
local repo. This will open a dialog and will use convenient defaults for the load. Refer to its documentation for more details.
- Optionally run the SUnit tests included in the map
TensorFlow
to ensure correct installation. One easy way is to right-click on theTensorFlow
map name in the Name pane (as opposed to version pane) and then selectTest Loaded Applications
.
Examples
We will be submitting more and more examples in TensorFlowExamplesApp
. So far the only working example is LabelImage
which loads a pre-trained TensorFlow network and use it to recognize objects in images. You can read its class comments for details, instructions and possible uses.
There is also a full detailed blog post about this example.
<img width="500" alt="LabelImage" src="https://pbs.twimg.com/media/EBOGuT1XoAAtQi1?format=jpg">You can also run a Inception V3 like what is described here:
<img width="500" alt="LabelImage" src="https://marianopeck.files.wordpress.com/2019/08/screen-shot-2019-08-02-at-11.12.35-am.png">We also have a more advanced Object Detection example with bounding boxes, labels and scores. This blog post goes over the glory details of this example:
<img width="500" alt="ObjectDetectionZoo" src="https://i1.wp.com/marianopeck.blog/wp-content/uploads/2019/08/Screen-Shot-2019-08-18-at-12.34.23-PM.png?resize=768%2C519&ssl=1">Running TensorFlow and VA Smalltalk on ARM
We believe that running TensorFlow and VA Smalltalk on ARM-based boards is really interesting. From limited devices such as a Raspberry Pi to a Nvidia Jetson.
We have compiled TensorFlow C library for ARM and ARM 64 and have been playing with different operating systems and boards such as Raspberry Pi 3B+ (Raspbian), Rock64 (Armbian) and soon Nvidia Jetson Nano and XT2.
Building TensorFlow from scratch on ARM is a bit complicated so we try to document this process on blog posts as we learn. For the moment, you can checkout these:
- Challenge Accepted: Build TensorFlow C Binding for Raspberry Pi in 2019
- The battle continues: Build TensorFlow C Binding for Raspberry Pi in 2019
Blog Posts
- Getting Started with Nvidia Jetson Nano, TensorFlow and Smalltalk
- Recognizing objects in images with TensorFlow and Smalltalk
- Object Detection with TensorFlow and Smalltalk
- TensorFlow — The first week
- Challenge Accepted: Build TensorFlow C Binding for Raspberry Pi in 2019
- The battle continues: Build TensorFlow C Binding for Raspberry Pi in 2019
Acknowledgments
- gera for all his work on the original code for Cuis Smalltalk as well as for the port to VA Smalltalk.
- Github repository layout was generated with Ba-St Github-setup project.
Contributing
Check the Contribution Guidelines