First Steps With Ai on Jetson TX2

A project log for WEEDINATOR 2019

The WEEDINATOR project continues .... The inevitability of robots working on farms draws ever nearer ....

capt-flatus-oflahertyCapt. Flatus O'Flaherty ☠ 09/16/2018 at 15:120 Comments

I really thought that there could not be any more files to upload after the marathon 4 month Jetpack install debacle ..... But, as might be expected, there were still many tens of thousands more to go. The interweb points to using a program called 'DIGITS' to get started 'quickly' , yet this was later defined to be a mere '2 days' work !!!! Anyway, after following the instructions at: I eventually had some success. Not surprisingly, DIGITS needed a huge load of dependancies and I had to back track through each one, through 'dependencies of dependencies of dependencies' ....... A dire task for a relative Ubuntu beginner like myself.

Fortunately, I had just about enough experience to spot the mistakes in each instruction set - usually a missing 'sudo' or failiure to cd into the right directory. A total beginner would have absolutely no chance ! For me, at least, deciphering the various error messages was extremely challenging. I made a note of most of the steps / problems pasted at the end of this log, which will probably make very little sense to anyone as very often I had to back track to get dependancies installed properly eg .

Anyway, here is my first adventure with Ai - recognising a O:

  File "/usr/local/lib/python2.7/dist-packages/protobuf-3.2.0-py2.7-linux-aarch64.egg/google/protobuf/", line 46, in <module>
    from google.protobuf.pyext import _message
ImportError: cannot open shared object file: No such file or directory


# For Ubuntu 16.04


# Install repo packages
wget "$CUDA_REPO_PKG" -O /tmp/cuda-repo.deb && sudo dpkg -i /tmp/cuda-repo.deb && rm -f /tmp/cuda-repo.deb

wget "$ML_REPO_PKG" -O /tmp/ml-repo.deb && sudo dpkg -i /tmp/ml-repo.deb && rm -f /tmp/ml-repo.deb

# Download new list of packages
sudo apt-get update

sudo apt-get install --no-install-recommends git graphviz python-dev python-flask python-gevent python-h5py python-numpy python-pil python-pip python-scipy python-tk


sudo apt-get install autoconf automake libtool curl make g++ git python-dev python-setuptools unzip


$ git clone
$ cd protobuf
$ git submodule update --init --recursive
$ ./
To build and install the C++ Protocol Buffer runtime and the Protocol Buffer compiler (protoc) execute the following:

$ ./configure
$ make
$ make check
$ sudo make install
$ sudo ldconfig # refresh shared library cache.
cd python
sudo python install --cpp_implementation

Download Source
DIGITS is currently compatiable with Protobuf 3.2.x

# example location - can be customized
export PROTOBUF_ROOT=~/protobuf
git clone $PROTOBUF_ROOT -b '3.2.x'
Building Protobuf
make "-j$(nproc)"
make install
cd python
sudo python install --cpp_implementation
This will ensure that Protobuf 3 is installed.

              ------------------ DONE -------------------------

sudo apt-get install --no-install-recommends build-essential cmake git gfortran libatlas-base-dev libboost-filesystem-dev libboost-python-dev
               ----------- DONE -----------------------------------

sudo apt-get install libboost-system-dev libboost-thread-dev libgflags-dev libgoogle-glog-dev libhdf5-serial-dev libleveldb-dev liblmdb-dev libopencv-dev libsnappy-dev python-all-dev python-dev python-h5py python-matplotlib python-numpy python-opencv python-pil python-pip python-pydot python-scipy python-skimage python-sklearn

         ----------------- DONE -------------------------------

export CAFFE_ROOT=~/caffe
git clone $CAFFE_ROOT -b 'caffe-0.15'

      ------------- Done ------------------

sudo pip install -r $CAFFE_ROOT/python/requirements.txt

           ----------------- DONE with errors -------------------
?????????????   pip install --upgrade pip

apt-get install protobuf-compiler
cmake -DBLAS=open

mkdir build
cd build
cmake ..                          --------------   originally Could NOT find Protobuf (missing: PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR) but now corrected
make -j"$(nproc)"                  ---------------- /usr/include/c++/5/typeinfo:39:37: error: expected ‘}’ before end of line

I solved this problem by modifying CMakeList.txt

# ---[ Flags


# ---[ Flags
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++11")

make install

git clone $DIGITS_ROOT

sudo pip install -r $DIGITS_ROOT/requirements.txt

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 7, in <module>
    from pip._internal import main
ImportError: No module named _internal

sudo easy_install pip

sudo pip install -e $DIGITS_ROOT

Starting the server:

export CAFFE_ROOT=/home/mx/caffe/
cd digits

ValueError: Caffe executable not found in PATH ........... export CAFFE_ROOT=/home/mx/caffe/
echo "export CAFFE_ROOT=/home/nvidia/caffe/" >> ~/.profile
source ~/.profile

ImportError: cannot open shared object file: No such file or directory

Starts a server at http://localhost:5000/.

python -m digits.download_data mnist ~/mnist

Other notes:

To fix the problem, all you need to do is to remove the lock files. You can do that easily using the commands below:

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
After that, reconfigure the packages

sudo dpkg --configure -a

The command to remove an apt repository is apt-add-repository with the -r option which will remove instead of add the repository. So in your case, the full command would be:

sudo add-apt-repository -r ppa:colingille/freshlight