Tensorflow in livecd

# HowTo
https://github.com/developmentseed/label-maker/blob/master/examples/walkthrough-tensorflow-object-detection.md#create-the-training-dataset
https://www.cs.toronto.edu/~vmnih/data/
https://becominghuman.ai/tensorflow-object-detection-api-tutorial-training-and-evaluating-custom-object-detector-ed2594afcf73
 
# System packages
sudo apt-get install python3-venv curl libcurl4-openssl-dev build-essential autoconf libssl-dev libffi-dev python3-dev protobuf-compiler python-pil python-lxml python-tk python3-tk
 
# label-maker deps...
stahnout https://github.com/mapbox/tippecanoe
sudo apt-get install libsqlite3-dev
make -j 2
sudo make install
 
# Python virtualenv not to fight with dependency hell
mkdir tenf
cd ./tenf
python3 -m venv venv
source venv/bin/activate
(venv) pip install --upgrade pip
(venv) pip install --upgrade tensorflow
(venv) pip install label-maker
(venv) pip install pandas
 
# get maptiles
mapbox.com -> login -> new account
tftest:tftest123
mapbox.com -> login -> tokens -> default public token
pk.eyJ1IjoidGZ0ZXN0IiwiYSI6ImNqeTJ3b2xzdDBxeDAzYm1zajB5MHhsYmEifQ.FJ7VJS9iMVi8pAQHzFgJgQ
nahradit ACCESS_TOKEN za token z web mapboxu
 
(venv) label-maker download
(venv) label-maker labels
(venv) label-maker images
 
stahnout https://github.com/tensorflow/models do ./tenf
 
(venv) pip install Cython
(venv) pip install contextlib2
(venv) pip install jupyter
(venv) pip install matplotlib
 
stahnout https://github.com/cocodataset/cocoapi do ./tenf
 
(venv) cd ./cocoapi-master/PythonAPI
(venv) make
(venv) cp -rfv ./pycocotools ../../models-master/research/
 
(venv) mkdir ../../protoc33 # v rootu ./tenf 
stahnout https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip a rozbalit do ./tenf/protoc33
(venv) cd ./models-master/research/
(venv) ../../protoc33/bin/protoc object_detection/protos/*.proto --python_out=.
(venv) export PYTHONPATH=`pwd`:`pwd`/slim
 
(venv) pip3 install "numpy == 1.15.0"
(venv) pip install -U protobuf
(venv) python ./setup.py build
(venv) python ./setup.py install
 
(venv) python3 object_detection/builders/model_builder_test.py
 
(venv) cd ./object_detection
(venv) wget "https://raw.githubusercontent.com/developmentseed/label-maker/master/examples/utils/tf_records_generation.py"
 
(venv) cp -rfv ../../../data/labels.npz ./
(venv) cp -rfv ../../../data/tiles ./
 
download http://download.tensorflow.org/models/object_detection/ssd_inception_v2_coco_2017_11_17.tar.gz a rozbal do /research/object_detection (TOD)
(venv) mkdir training
(venv) wget "https://raw.githubusercontent.com/developmentseed/label-maker/master/examples/utils/ssd_inception_v2_coco.config" -O ./training/ssd_inception_v2_coco.config
(venv) wget "https://raw.githubusercontent.com/developmentseed/label-maker/master/examples/utils/building_od.pbtxt" -O ./data/building_od.pbtxt
 
# Uz budu
python ./model_main.py --logtostderr --model_dir=./training/ --pipeline_config_path=./training/ssd_inception_v2_coco.config