Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ncf #59

Open
wants to merge 63 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
f0893f1
Merge pull request #1 from trevor-m/tmorris_add_example
Nov 30, 2018
5302cdf
added object detection example (#2)
Nov 30, 2018
7ce2690
Update README.md
Dec 1, 2018
b083b98
Update README.md
Dec 1, 2018
06ed779
Correct broken link (#4)
ritwik12 Dec 2, 2018
25ec995
Update README.md (#6)
Dec 9, 2018
b1dbe80
Score thresh bug fix (#7)
Dec 21, 2018
73279e6
change calibration dataset (#9)
Dec 21, 2018
5524798
add frozen_graph size (#5)
Dec 21, 2018
494824a
Update README.md
Dec 11, 2018
62c15df
Fix an error when there is no data file in data_dir
Dec 11, 2018
d7f6bd9
Merge pull request #10 from pooyadavoodi/fix_image_classification
Dec 21, 2018
bbc973b
Decrease default workspace size from 8GB to 4GB
Dec 22, 2018
4d20694
Print graph size for both TF and TRT graphs
Dec 22, 2018
7fe06a3
Fix third_party submodules
Dec 22, 2018
1af9202
Revert change in .gitmodules
Dec 22, 2018
b1754de
Update submodules
Dec 22, 2018
24945f6
Update submodule
Dec 22, 2018
4ff1325
Merge pull request #11 from pooyadavoodi/image_classification_cleanup
Dec 22, 2018
9ec4769
Add install_dependencies.sh for image-classification
Jan 8, 2019
f75ac68
Merge pull request #13 from pooyadavoodi/install_dependencies_img_class
Jan 8, 2019
e058613
print model url (#15)
Jan 15, 2019
7d09606
fixed validation files requirement for synthetic (#8)
Jan 15, 2019
d577525
enable use_synthetic for calibration (#17)
Jan 15, 2019
03a9134
Update readme (#19)
trevor-m Jan 28, 2019
34344a9
Updated install_dependencies.sh (#18)
anujonthemove Feb 1, 2019
90d62f6
Addin target_duration argument (#23)
otstrel Feb 12, 2019
ee7f173
add_benchmark_mode (#21)
Feb 28, 2019
edd05b5
update models (#24)
Feb 28, 2019
78f883f
Pull in sections from Accelerating Inference Guide (#27)
btp Feb 28, 2019
d2c28ff
add params to tftrt conversion (#30)
Mar 1, 2019
0d97bb8
Create Jupyter notebook for image classification example (#28)
btp Mar 2, 2019
c4a7d5a
Fixed bug that precision does not support lowercase (#29)
haohaibo Mar 5, 2019
703031e
Remove redundant argument `run_calibration`
Mar 10, 2019
9c53bcb
Update README.md
Mar 12, 2019
950811e
Change default value of obj detection args (#31)
Mar 14, 2019
bb8a441
restrict latency timing around session.run (#37)
pcicotti Mar 14, 2019
ccc5f18
update log print (#38)
Mar 14, 2019
b5ff3a1
Added median and min to performance report. (#35)
pcicotti Mar 27, 2019
6cc3846
Add option to store trt engine. Save frozen graph before tf_trt conve…
pcicotti Mar 27, 2019
9464cc2
support synthetic for object detection (#26)
Mar 27, 2019
35ae9ee
add conversion stats (#48)
Mar 27, 2019
8aa02d9
fix data files requirement for synthetic data (#47)
Mar 27, 2019
e3622b1
update hook position for performance measurement (#43)
ttyio Mar 28, 2019
7cb3fd3
update readme
Mar 28, 2019
3609166
Remove end argument from print for py2 compatibility
Mar 29, 2019
36ef354
Store constant input tensor on GPU
Mar 29, 2019
8f51645
Merge pull request #50 from pooyadavoodi/py2_gpuConstant
Mar 29, 2019
2b07cdb
Merge pull request #49 from mdrozdowski1996/update_readme
Mar 29, 2019
a60cd64
Use uppercase letters for precision mode
Mar 3, 2019
d36fea6
Add docs for new args
Mar 4, 2019
2107719
Error out if max_batch_size>1 and calib_image_shape is not set
Mar 18, 2019
945461d
Fix links to TF-TRT docs (#51)
trevor-m Apr 10, 2019
57d885b
Merge pull request #54 from pooyadavoodi/update_scripts_docs
Apr 10, 2019
95e5941
Use `-q` for wget in image_classification.py (#55)
Apr 10, 2019
45a9165
Revert updating submodule tftrt/examples/third_party/models
Apr 12, 2019
d67a79f
Fixing parentheses (#57)
otstrel Apr 16, 2019
e51c6c8
add inference_script
Apr 22, 2019
660b21d
add DeepLearningExamples submodule
Apr 22, 2019
29a6c84
support estimator
Apr 24, 2019
b5c0e13
add README.md file
Apr 24, 2019
a2fb19a
Update README.md
Apr 24, 2019
b6bb44a
code refactor
Apr 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "tftrt/examples/third_party/models"]
path = tftrt/examples/third_party/models
url = https://github.com/tensorflow/models.git
[submodule "tftrt/examples/third_party/cocoapi"]
path = tftrt/examples/third_party/cocoapi
url = https://github.com/cocodataset/cocoapi.git
[submodule "tftrt/examples/third_party/DeepLearningExamples"]
path = tftrt/examples/third_party/DeepLearningExamples
url = https://github.com/NVIDIA/DeepLearningExamples.git
86 changes: 85 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,85 @@
Coming soon: Examples using [NVIDIA TensorRT](https://developer.nvidia.com/tensorrt) in TensorFlow.
# Documentation for TensorRT in TensorFlow (TF-TRT)

The documentaion on how to accelerate inference in TensorFlow with TensorRT (TF-TRT) is here: https://docs.nvidia.com/deeplearning/dgx/tf-trt-user-guide/index.html

# Examples for TensorRT in TensorFlow (TF-TRT)

This repository contains a number of different examples
that show how to use
[TF-TRT](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/tensorrt).
TF-TRT is a part of TensorFlow
that optimizes TensorFlow graphs using
[TensorRT](https://developer.nvidia.com/tensorrt).
We have used these examples to verify the accuracy and
performance of TF-TRT. For more information see
[Verified Models](https://docs.nvidia.com/deeplearning/dgx/tf-trt-user-guide/index.html#verified-models).

## Examples

* [Image Classification](tftrt/examples/image-classification)
* [Object Detection](tftrt/examples/object_detection)


# Using TensorRT in TensorFlow (TF-TRT)

This module provides necessary bindings and introduces
`TRTEngineOp` operator that wraps a subgraph in TensorRT.
This module is under active development.


## Installing TF-TRT

Currently Tensorflow nightly builds include TF-TRT by default,
which means you don't need to install TF-TRT separately.
You can pull the latest TF containers from docker hub or
install the latest TF pip package to get access to the latest TF-TRT.

If you want to use TF-TRT on NVIDIA Jetson platform, you can find
the download links for the relevant Tensorflow pip packages here:
https://docs.nvidia.com/deeplearning/dgx/index.html#installing-frameworks-for-jetson


## Installing TensorRT

In order to make use of TF-TRT, you will need a local installation
of TensorRT from the
[NVIDIA Developer website](https://developer.nvidia.com/tensorrt).
Installation instructions for compatibility with TensorFlow are provided on the
[TensorFlow GPU support](https://www.tensorflow.org/install/gpu) guide.


## Documentation

[TF-TRT documentaion](https://docs.nvidia.com/deeplearning/dgx/tf-trt-user-guide/index.html)
gives an overview of the supported functionalities, provides tutorials
and verified models, explains best practices with troubleshooting guides.


## Tests

TF-TRT includes both Python tests and C++ unit tests.
Most of Python tests are located in the test directory
and they can be executed uring `bazel test` or directly
with the Python command. Most of the C++ unit tests are
used to test the conversion functions that convert each TF op to
a number of TensorRT layers.


## Compilation

In order to compile the module, you need to have a local TensorRT installation
(libnvinfer.so and respective include files). During the configuration step,
TensorRT should be enabled and installation path should be set. If installed
through package managers (deb,rpm), configure script should find the necessary
components from the system automatically. If installed from tar packages, user
has to set path to location where the library is installed during configuration.

```shell
bazel build --config=cuda --config=opt //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/
```


## License

[Apache License 2.0](LICENSE)
27 changes: 27 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================

from setuptools import find_packages, setup

setup(
name='tftrt',
version='0.0',
description='NVIDIA TensorRT integration in TensorFlow',
author='NVIDIA',
packages=find_packages(),
install_requires=['tqdm']
)
16 changes: 16 additions & 0 deletions tftrt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
16 changes: 16 additions & 0 deletions tftrt/examples/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
Loading