{"id":20172670,"url":"https://github.com/merantix/imitation-learning","last_synced_at":"2025-04-10T02:56:54.488Z","repository":{"id":33741971,"uuid":"161205089","full_name":"merantix/imitation-learning","owner":"merantix","description":"Autonomous driving: Tensorflow implementation of the paper \"End-to-end Driving via Conditional Imitation Learning\"","archived":false,"fork":false,"pushed_at":"2022-11-22T02:54:47.000Z","size":31290,"stargazers_count":94,"open_issues_count":17,"forks_count":21,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-24T04:24:08.049Z","etag":null,"topics":["autonomous-driving","docker","imitation-learning","machine-learning","paper","python","robocars","tensorflow"],"latest_commit_sha":null,"homepage":"https://medium.com/merantix/journey-from-academic-paper-to-industry-usage-cf57fe598f31","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/merantix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-10T16:37:46.000Z","updated_at":"2025-03-09T14:50:42.000Z","dependencies_parsed_at":"2023-01-15T02:30:31.960Z","dependency_job_id":null,"html_url":"https://github.com/merantix/imitation-learning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merantix%2Fimitation-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merantix%2Fimitation-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merantix%2Fimitation-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merantix%2Fimitation-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/merantix","download_url":"https://codeload.github.com/merantix/imitation-learning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248147730,"owners_count":21055545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autonomous-driving","docker","imitation-learning","machine-learning","paper","python","robocars","tensorflow"],"created_at":"2024-11-14T01:31:52.261Z","updated_at":"2025-04-10T02:56:54.456Z","avatar_url":"https://github.com/merantix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Imitation learning [![Build Status](https://travis-ci.org/merantix/imitation-learning.svg?branch=master)](https://travis-ci.org/merantix/imitation-learning) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Check%20this%20out:%20A%20Tensorflow%20implementation%20of%20the%20paper%20End-to-end%20Driving%20via%20Conditional%20Imitation%20Learning\u0026url=https://github.com/merantix/imitation-learning\u0026via=merantix\u0026hashtags=tensorflow,imitation-learning,autonomous-driving,robocars,paper,docker,machine-learning,python)\n\nThis repository provides a Tensorflow implementation of the paper \n[End-to-end Driving via Conditional Imitation Learning](http://vladlen.info/papers/conditional-imitation.pdf).\n\nYou can find a pre-trained network\n[here](https://github.com/carla-simulator/imitation-learning/). \nThe repository at hand adds Tensorflow training code. \n\nThere are only a few changes to the setup in the paper:\n* We train less steps (we do 190k steps, the paper does 450k steps), but this is configurable.\n* The branches for the controller follow the order of the training data.\n* We take different weight hyperparameters for the outputs (steer, gas, brake, speed), \n  since the hyperparameters suggested in the paper did not work for us.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/merantix/imitation-learning/master/img/short_5s_teaser.gif\"\u003e\n\u003c/p\u003e\n\n### Setup\n\nThis repository uses docker images. In order to use it, install [docker](https://docs.docker.com/install/). \nTo build the image, use:\n\n```bash\ndocker build --build-arg base_image=tensorflow/tensorflow:1.12.0-gpu -t imit-learn .\n```\n\nIf you only need a CPU image, leave out `base_image=tensorflow/tensorflow:1.12.0-gpu`.\nSo far, we only tested the setup with Python2, which `tensorflow:1.12.0` is based on.\n\nTo run a container, use:\n\n```bash\ncd \u003croot of this repository\u003e\nDOCKER_BASH_HISTORY=\"$(pwd)/data/docker.bash_history\"\ntouch $DOCKER_BASH_HISTORY\n\ndocker run -it --rm --name imit_learn \\\n    -v \"$(pwd)/imitation:/imitation\" \\\n    -v \"$(pwd)/data:/data\" \\\n    -v \"$DOCKER_BASH_HISTORY:/root/.bash_history\" \\\n    imit-learn bash\n```\n\nDownload [dataset](https://github.com/carla-simulator/imitation-learning/#user-content-dataset) (24GB).\nUnpack!\nPut them into `data/imitation_learning/h5_files/AgentHuman`.\n\nIf you don't wanna download all the data right away, you can try on a very small subset\nthat is contained in this repository. To set it up, run:\n\n```bash\ncd \u003croot of this repository\u003e\nmkdir data/imitation_learning/h5_files/\ncp -r imitation/test/mock_data_181018/imitation_learning/h5_files/ data/imitation_learning/h5_files/\n```\n\n### Preprocessing\n\nThe preprocessing converts the downloaded h5 files into tfrecord files\nso we can easier use them for training with Tensorflow.\n\nDuring preprocessing, the data is shuffled to a certain degree.\nMore specifically speaking, it is shuffled the h5 files, but it is not shuffling the frames inside an h5 file.  \nShuffling across files is achieved by using a big shuffle buffer during training.\n\nRun preprocessing using:\n\n ```bash\nmkdir -p /data/imitation_learning/preprocessed/\npython /imitation/preprocessor.py --preproc_config_paths=config-preprocess-production.yaml\n```\n\nThis might run for a while and slow consume a lot of CPU power.\nTo simply check that the preprocessing code can run, set `--preproc_config_paths=config-preprocess-debug.yaml`.\n\n\n### Train\n\nIn order for the training to run, training and validation data need to be in the right place as described above.\nTo run training with best hyperparameters on the \nentire dataset, run:\n\n```bash\npython trainer.py --config_paths=config-train-production.yaml\n```\n\nTo debug training, use:\n\n```bash\npython trainer.py --config_paths=config-train-debug.yaml\n```\n\n\n### Tests\n\n```bash\npytest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmerantix%2Fimitation-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmerantix%2Fimitation-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmerantix%2Fimitation-learning/lists"}