Check the preview of 2nd version of this platform being developed by the open MLCommons taskforce on automation and reproducibility as a free, open-source and technology-agnostic on-prem platform.
program:retrain-tfzoo-cocotokitti (v1.0.0)
Creation date: 2019-08-26
Source: GitHub
cID: b0ac08fe1d3c2615:19f241eab6bab8bd

Don't hesitate to get in touch if you encounter any issues or would like to discuss this community project!
Please report if this CK component works: 1  or fails: 0 
Sign up to be notified when artifacts are shared or updated!

Description  

This portable workflow is our attempt to provide a common CLI with Python JSON API and a JSON meta description to automatically detect or install required components (models, data sets, libraries, frameworks, tools), and then build, run, validate, benchmark and auto-tune the associated method (program) across diverse models, datasets, compilers, platforms and environments. Our on-going project is to make the onboarding process as simple as possible via this platform. Please check this CK white paper and don't hesitate to contact us if you have suggestions or feedback!
  • Automation framework: CK
  • Development repository: ck-object-detection
  • Source: GitHub
  • Available command lines:
    • ck run program:retrain-tfzoo-cocotokitti --cmd_key=a:create_dataset (META)
    • ck run program:retrain-tfzoo-cocotokitti --cmd_key=b:retrain (META)
    • ck run program:retrain-tfzoo-cocotokitti --cmd_key=c:export_model (META)
  • Support for host OS: any
  • Support for target OS: any
  • Tags: object-detection,tf,lang-python,retrain,cocotokitti
  • How to get the stable version via the client:
    pip install cbench
    cb download program:retrain-tfzoo-cocotokitti --version=1.0.0 --all
    ck run program:retrain-tfzoo-cocotokitti
  • How to get the development version:
    pip install ck
    ck pull repo:ck-object-detection
    ck run program:retrain-tfzoo-cocotokitti

  • CLI and Python API: module:program
  • Dependencies    

    ReadMe  

    CK Object Detection Retraining Utilities

    Warning: Not all the operations in this program can be automatized, some jobs in the pipeline MUST be manually handled by the user. Moreover, this will work only with models coming from the tensorflow zoo.

    Prerequisites

    Install CK

    Please follow the CK installation instructions.

    Pull CK repositories

    $ ck pull repo:ck-tensorflow
    

    Install TensorFlow

    Install TensorFlow v1.14 from source (built with Bazel):

    $ ck install package --tags=lib,tensorflow,v1.14,vsrc,vcpu
    

    or from a binary x86_64 package (installed via pip):

    $ ck install package --tags=lib,tensorflow,v1.14,vprebuilt,vcpu
    

    Replace vcpu with vcuda to install TensorFlow with GPU support.

    Or you can choose interactively from any available version of TensorFlow:

    $ ck install package --tags=lib,tensorflow
    

    Install TensorFlow models

    $ ck install package --tags=tensorflow,model,api
    

    Install one or more object detection model package:

    $ ck install package --tags=tf,model,object-detection
    

    Datasets

    Install the kitti full dataset

    $ ck install package --tags=dataset,object-detection,kitti-full
    

    Other Dependencies

    Install the pycocotool

    $ ck install package --tags=tool,coco
    

    Programs

    There are three different programs in this pipeline:

    Program Task
    a:create_dataset creates a tf compatible record from the kitti dataset, and copies the required pipeline and checkpoint from the model folder to the working directory
    b:retrain performs the retraining or the fine tuning, according to the (manual) configuration of the pipeline
    c:export_model creates a frozen_graph from a checkpoint

    In order to obtain a completely working model, you will need to run them in this order and add some manual work between the dataset creation and the retrain.

    a:create_dataset

    This program will prepare the required data for the retraining. All the parameters are provided by default ( I am not sure about the CK_OUTPATH, which is an empty string, if it means current working directory or if i just forgot it, need to test it). They can be overridden by setting the appropriate CK env variables.

    After the create dataset, the pipeline.config is copied in the /tmp folder, which is the working directory. Now you have to manually edit the file. There are some more mechanical tasks, and other less intuitive and it may not work. In that case, it is possible that they changed some parameters in the tensorflow object detection repository, and you may have to search on google how to edit the pipeline in order to retrain/finetune.

    The mandatory (and easy) tasks that must be performed are: - Change the dataset-related info in the first block. In particular, we target the kitti dataset so this have 7 classes (car,van,truck,pedestrian,person_sitting,cyclist,tram). Moreover, the images in the dataset have a different shape, so the resizer must be set at 375(height)*1242(width). - Modify the path wherever the PATH_TO_BE_CONFIGURED string appears. You must use ABSOLUTE path. - If you want to retrain, you will have to provide a starting checkpoint (again, you will need an absolute path). And if not set you will need to set the from_detection_checkpoint: true and load_all_detection_checkpoint_vars: true

    Other possible issues (from my experience): - if a schedule with step 0 appears in the pipeline.config, in the manual_step_learning_rate, has to be removed. It is an old version of the API and has been removed and it causes the training to fail. - with lowproposals models, the fiels "second_stage_batch_size" has to be added, immediately after "first_stage_objectness_loss_weight", with a value lower than "first_stage_max_proposals".

    b:retrain

    This program will perform the actual retraining. All the parameters are set by default beside one, the number of steps for the retraining. This must be set when calling the program, using the CK env variable 'CK_NUM_STEPS'.

    c:export_model

    This program will create the frozen graph, with the checkpoints and everything that is needed to "restart" in the future, and also creating the graph that can be used for inference. It will require a mandatory parameter, 'CK_CHECKPOINT_PREFIX', that will select the checkpoint to use for the export. it must be one of the checkpoints in the 'model.ckpt' folder, contained in the working directory (called tmp). The exported graph will be crated in the 'output_dir' inside the tmp folder. This can be overridden by changing the 'CK_OUT_DIR' env variable. All the other parameters are set by default, and can be overridden by using the appropriate CK variables

    Versions  

    Files  

    Comments  

    Please log in to add your comments!
    If you notice any inapropriate content that should not be here, please report us as soon as possible and we will try to remove it within 48 hours!