tensorrt icon indicating copy to clipboard operation
tensorrt copied to clipboard

C++ serving example: adding saved model path

Open vinhngx opened this issue 2 years ago • 6 comments

This PR extends the current C++ image classification example with a saved model path. The two workflows are thus:

  • Keras saved model ->TFTRT Python API -> frozen graph -> CPP serving
  • Keras saved model ->TFTRT Python API -> saved model -> CPP serving

Reorganizing the two path into two separate subfolders and add a master readme.

vinhngx avatar Apr 29 '22 06:04 vinhngx

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@meena-at-work: for review

DEKHTIARJonathan avatar Jun 13 '22 23:06 DEKHTIARJonathan

@DEKHTIARJonathan @meena-at-work any feedback please?

vinhngx avatar Jun 30 '22 23:06 vinhngx

Thanks @meena-at-work for the review. By and large, I'd keep the two paths separate and clean.

Conceptually it is possible to lump everything together and use "flags" to redirect, but I don't see much benefit if at all. Most users will use one path or another in their code base, not both. So better to keep them separate.

I think we can make the loading code in a separate file.

vinhngx avatar Jul 19 '22 02:07 vinhngx

@vinhngx -- I was considering that too (command line option vs just making a new example), and I think that's fair from a demo application point of view. However, if that's the case && we want to gain most value from these examples, we should keep the common code & the model loading code in separate files (and I think we're in agreement on that, based on your comment!). So if you can refactor the code to reflect the above along with the other changes, I can approve the PR.

meena-at-work avatar Jul 20 '22 21:07 meena-at-work

@vinhngx this path is completely useless:

  • Keras saved model ->TFTRT Python API -> frozen graph -> CPP serving

TF-TRT freeze the graph already during the conversion process

DEKHTIARJonathan avatar Aug 02 '22 02:08 DEKHTIARJonathan