-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update in How-to - Missing links and Reference section now added (#4641)
* Update in How-to * Missing link in readme - perception visualizer * updating how-to * updating how-to * updating how-to * updating how-to
- Loading branch information
1 parent
bbc3be2
commit 7c6f2d7
Showing
8 changed files
with
85 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
## How to Add a New External Dependency | ||
A design and implementation goal is to minimize the dependency that must be pre-installed in the system. If your target depends on a module for which you have to `apt-get install` first, consider using bazel as the package/dependency management system. | ||
|
||
For example if you want to add a workspace rule `foo` that is not originally built with bazel, do the following: | ||
The design and implementation goal is to minimize the dependency that must be pre-installed in the system. If your target depends on a module for which you have to `apt-get install` first, consider using **Bazel** as the package/dependency management system. | ||
|
||
For example, if you want to add a workspace rule `foo` that is not originally built with Bazel, do the following: | ||
|
||
- Add a workspace rule named 'foo' in the WORKSPACE file. | ||
- Specify the source of `foo` (usually a URL), and the version (usually a commit hash or a git tag). | ||
- Write a `foo.BUILD` under a third_party directory to build it. The BUILD file will be similar to any other bazel BUILD file of your own targets. | ||
- Write a `foo.BUILD` under the third_party directory to build it. The BUILD file will be similar to any other Bazel BUILD file of your own targets. | ||
- In your target that depends on `foo`, put `@foo://:<foo_target>` in its dependencies. | ||
|
||
### Use Bazel to Add an External Dependency | ||
|
||
If you add a workspace rule `foo` using bazel to build your target, depending on `foo`, bazel pulls the source code of `foo` from the source specified, and builds it with `foo.BUILD`. If `foo` was originally built with bazel, then only the workspace rule is needed. | ||
If you add a workspace rule `foo` using Bazel to build your target, depending on `foo`, Bazel pulls the source code of `foo` from the source specified, and builds it with `foo.BUILD`. If `foo` was originally built with Bazel, then only the workspace rule is needed. | ||
|
||
### References | ||
|
||
Click on the following links for a more detailed description on adding a dependency with bazel: | ||
[Workspace Rules](https://bazel.build/versions/master/docs/be/workspace.html), | ||
[Working with external dependencies](Working with external dependencies). | ||
For a detailed description on adding a dependency with Bazel, refer to the following: | ||
* [Workspace Rules](https://bazel.build/versions/master/docs/be/workspace.html) | ||
* [Working with external dependencies](https://docs.bazel.build/versions/master/external.html). |
3 changes: 1 addition & 2 deletions
3
...howto/how_to_prepare_centosbased_gpu_enabled_image_for_ROS_perception_module.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,54 @@ | ||
## Tutorial on training MLP Deep Learning Model | ||
## How to train the MLP Deep Learning Model | ||
|
||
### Prerequisite | ||
### Prerequisites | ||
There are 2 prerequisites to training the MLP Deep Learning Model: | ||
#### Download and Install Anaconda | ||
* Please refer to https://www.anaconda.com/download | ||
* Please download and install Anaconda from its [website](https://www.anaconda.com/download) | ||
|
||
#### Install Necessary Dependencies | ||
* Install numpy: `conda install numpy` | ||
* Install tensorflow: `conda install tensorflow` | ||
* Install keras (version 1.2.2): `conda install -c conda-forge keras=1.2.2` | ||
* Install h5py: `conda install h5py` | ||
* Install protobuf: `conda install -c conda-forge protobuf` | ||
#### Install Dependencies | ||
Run the following commands to install the necessary dependencies: | ||
* **Install numpy**: `conda install numpy` | ||
* **Install tensorflow**: `conda install tensorflow` | ||
* **Install keras (version 1.2.2)**: `conda install -c conda-forge keras=1.2.2` | ||
* **Install h5py**: `conda install h5py` | ||
* **Install protobuf**: `conda install -c conda-forge protobuf` | ||
|
||
### Procedure | ||
The following is the precedure to train the MLP model using the released demo data. For convenience, we denote `APOLLO` as the path of the local apollo repository, for example `/home/username/apollo`. | ||
### Train the Model | ||
The following steps are to be followed in order to train the MLP model using the released demo data. For convenience, we denote `APOLLO` as the path of the local apollo repository, for example, `/home/username/apollo` | ||
|
||
1. Create a folder to store prediction offline data by `mkdir APOLLO/data/prediction` if it does not exist | ||
1. Create a folder to store offline prediction data using the command `mkdir APOLLO/data/prediction` if it does not exist | ||
|
||
2. Open `apollo/modules/prediction/conf/prediction.conf`. Turn on the off-line mode by changing `--noprediction_offline_mode` to `--prediction_offline_mode`. | ||
2. Open `apollo/modules/prediction/conf/prediction.conf`. Turn on the off-line mode by changing `--noprediction_offline_mode` to `--prediction_offline_mode` | ||
|
||
3. Start dev docker by `bash docker/scripts/dev_start.sh` under apollo folder. | ||
3. Start dev docker using `bash docker/scripts/dev_start.sh` under the apollo folder | ||
|
||
4. Enter dev docker by `bash docker/scripts/dev_into.sh` under apollo folder. | ||
4. Enter dev docker using `bash docker/scripts/dev_into.sh` under apollo folder | ||
|
||
5. In docker, under `/apollo/`, run `bash apollo.sh build` to compile. | ||
5. In docker, under `/apollo/`, run `bash apollo.sh build` to compile | ||
|
||
6. In docker, under `/apollo/`, download the demo rosbag by `python docs/demo_guide/rosbag_helper.py demo_2.0.bag` | ||
6. In docker, under `/apollo/`, download the demo ROSbag by `python docs/demo_guide/rosbag_helper.py demo_2.0.bag` | ||
|
||
7. In docker, under `/apollo/`, run prediction module by `bash scripts/prediction.sh start_fe` | ||
|
||
8. Open a new terminal window, enter the apollo dev docker by Step 4. | ||
8. Open a new terminal window, enter the apollo dev docker using Step 4 | ||
|
||
9. In the new terminal window, under `/apollo/`, play the demo rosbag by `rosbag play demo_2.0.bag` | ||
9. In the new terminal window, under `/apollo/`, play the demo rosbag using `rosbag play demo_2.0.bag` | ||
|
||
10. After the demo rosbag running is finished in the new terminal window, go to the old terminal window and stop the prediction module by pressing `Ctrl + C`. | ||
10. After the demo ROSbag finishes running in the new terminal window, go to the old terminal window and stop the prediction module by pressing `Ctrl + C` | ||
|
||
11. Checkout if there is a file called `feature.0.bin` under the folder `/apollo/data/prediction/` | ||
|
||
12. In docker, go to `/apollo/modules/tools/prediction/mlp_train/`, label the data by | ||
`python generate_labels.py -f /apollo/data/prediction/feature.0.bin`. Then checkout if there is a file called `feature.0.label.bin` under the folder `/apollo/data/prediction/` | ||
12. In docker, go to `/apollo/modules/tools/prediction/mlp_train/`, label the data using | ||
`python generate_labels.py -f /apollo/data/prediction/feature.0.bin`. Then check if there is a file called `feature.0.label.bin` under the folder `/apollo/data/prediction/` | ||
|
||
13. In docker under `/apollo/modules/tools/prediction/mlp_train/`, generate H5 files by `python generate_h5.py -f /apollo/data/prediction/feature.0.label.bin`. Then checkout if there is a file called `feature.0.label.h5` | ||
13. In docker, under `/apollo/modules/tools/prediction/mlp_train/`, generate H5 files using `python generate_h5.py -f /apollo/data/prediction/feature.0.label.bin`. Then check if there is a file called `feature.0.label.h5` created | ||
|
||
14. Exit dev docker | ||
|
||
15. Go to the folder `APOLLO/modules/tools/prediction/mlp_train/proto/` run `protoc --python_out=./ fnn_model.proto` to generate fnn_model_pb2.py | ||
|
||
16. Go to the folder `APOLLO/modules/tools/prediction/mlp_train/`, run the training model by `python mlp_train.py APOLLO/data/prediction/feature.0.label.h5` | ||
16. Go to the folder `APOLLO/modules/tools/prediction/mlp_train/`, run the training model using `python mlp_train.py APOLLO/data/prediction/feature.0.label.h5` | ||
|
||
17. The model's evaluation report will be in the file `APOLLO/modules/tools/prediction/mlp_train/evaluation_report.log`. | ||
17. The model's evaluation report will be in the file `APOLLO/modules/tools/prediction/mlp_train/evaluation_report.log` | ||
|
||
18. The model will be stored in the binary file `APOLLO/modules/tools/prediction/mlp_train/mlp_model.bin`, which can replace the old model in `APOLLO/modules/prediction/data/mlp_vehicle_model.bin` if you think it is better. | ||
18. The model will be stored in the binary file `APOLLO/modules/tools/prediction/mlp_train/mlp_model.bin`, which can replace the old model in `APOLLO/modules/prediction/data/mlp_vehicle_model.bin` if you think that's better |