This repository has been archived by the owner on Oct 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 553
TensorRT? #25
Labels
enhancement
New feature or request
Comments
+1 for that! We can do inference much better with a pb file :) |
@nickwalton any updates on getting the savedmodel.pb up for tinkering? Promise I'll only download it once to minimize your hosting costs! |
You should be able to load the model and save it as a savedmodel.pb. Can't you reconstruct it from the model? |
I tried a few different ways but couldn't get it to work for some reason. Do you happen to have a working code example or know the names of the variables to export? One of the solutions I tried: https://blog.metaflow.fr/tensorflow-how-to-freeze-a-model-and-serve-it-with-a-python-api-d4f3596b3adc |
Try something like this:
from generator.gpt2.gpt2_generator import *
generator = GPT2Generator()
model = generator.output
# Save the model to a .pb file
MODEL_DIR = "/content/Generator/saved"
version = 1
export_path = os.path.join(MODEL_DIR, str(version))
tf.saved_model.simple_save(generator.sess, export_path,
inputs={"context": generator.context}, outputs={"output":
generator.output})
…On Mon, Dec 9, 2019 at 9:30 PM Michael Pang ***@***.***> wrote:
I tried a few different ways but couldn't get it to work for some reason.
Do you happen to have a working code example or know the names of the
variables to export?
One of the solutions I tried:
https://blog.metaflow.fr/tensorflow-how-to-freeze-a-model-and-serve-it-with-a-python-api-d4f3596b3adc
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFJNOQEEPNLBQ4NFAIVJVDLQX4LPLANCNFSM4JXC5P4Q>
.
|
That worked! Beautiful, thanks |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm trying to get tensorRT working but I need the saved_model.pb file. Can you upload it?
The text was updated successfully, but these errors were encountered: