What are the parameters input_arrays and output_arrays that are needed to convert a frozen model '.pb' file to a '.tflite' file?Tensorflow: How to get a tensor by name?Given a tensor flow model graph, how to find the input node and output node namesDefine input and output tensors for tf.lite.TocoConverterTensorflow Convert pb file to TFLITE using pythonTensorFlow saved model export conversion to tfliteHow can I view weights in a .tflite file?How can you identify Input and Output name in tensorboard graph like this one in the pictures attached to this post?How to convert .pb to TFLite format?How to convert a HED model to Tensorflow Lite modelissue with converting keras h5 model file to tflite - Type Error('keyword argument not understood: ', 'interpolation')Convert Keras MobileNet model to TFLite with 8-bit quantizationHow to convert Dlib weights into tflite format?How to read parameters of layers of .tflite model in python
Are PMR446 walkie-talkies legal in Switzerland?
Why does Bran want to find Drogon?
Why was this character made Grand Maester?
How to remove new line added by readarray when using a delimiter?
Ribbon Cable Cross Talk - Is there a fix after the fact?
Is it normal to "extract a paper" from a master thesis?
Visual Block Mode edit with sequential number
Why do the i8080 I/O instructions take a byte-sized operand to determine the port?
How to find sum of maximum K elements in range in array
Are runways booked by airlines to land their planes?
ifconfig shows UP while ip link shows DOWN
Why'd a rational buyer offer to buy with no conditions precedent?
Why is std::ssize() introduced in C++20
resolution bandwidth
Testing using real data of the customer
How to escape dependency hell?
The disk image is 497GB smaller than the target device
Paired t-test means that the variances of the 2 samples are the same?
Writing "hahaha" versus describing the laugh
Set outline first and fill colors later
Using too much dialogue?
Did Game of Thrones end the way that George RR Martin intended?
Is "vegetable base" a common term in English?
What is the limit to a Glyph of Warding's trigger?
What are the parameters input_arrays and output_arrays that are needed to convert a frozen model '.pb' file to a '.tflite' file?
Tensorflow: How to get a tensor by name?Given a tensor flow model graph, how to find the input node and output node namesDefine input and output tensors for tf.lite.TocoConverterTensorflow Convert pb file to TFLITE using pythonTensorFlow saved model export conversion to tfliteHow can I view weights in a .tflite file?How can you identify Input and Output name in tensorboard graph like this one in the pictures attached to this post?How to convert .pb to TFLite format?How to convert a HED model to Tensorflow Lite modelissue with converting keras h5 model file to tflite - Type Error('keyword argument not understood: ', 'interpolation')Convert Keras MobileNet model to TFLite with 8-bit quantizationHow to convert Dlib weights into tflite format?How to read parameters of layers of .tflite model in python
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I need to convert my .pb tensorflow model together with my .cpkt file to a tflite model to make it work in Mobile Devices. Is there any straight-forward way to find out how can I find what are the parameters I should use for input_arrays and output_arrays?
import tensorflow as tf
graph_def_file = "/path/to/Downloads/mobilenet_v1_1.0_224/frozen_graph.pb"
input_arrays = ["input"]
output_arrays = ["MobilenetV1/Predictions/Softmax"]
converter = tf.lite.TFLiteConverter.from_frozen_graph(
graph_def_file, input_arrays, output_arrays)
tflite_model = converter.convert()
open("converted_model.tflite", "wb").write(tflite_model)
tensorflow keras tensorflow-lite yolo
add a comment |
I need to convert my .pb tensorflow model together with my .cpkt file to a tflite model to make it work in Mobile Devices. Is there any straight-forward way to find out how can I find what are the parameters I should use for input_arrays and output_arrays?
import tensorflow as tf
graph_def_file = "/path/to/Downloads/mobilenet_v1_1.0_224/frozen_graph.pb"
input_arrays = ["input"]
output_arrays = ["MobilenetV1/Predictions/Softmax"]
converter = tf.lite.TFLiteConverter.from_frozen_graph(
graph_def_file, input_arrays, output_arrays)
tflite_model = converter.convert()
open("converted_model.tflite", "wb").write(tflite_model)
tensorflow keras tensorflow-lite yolo
add a comment |
I need to convert my .pb tensorflow model together with my .cpkt file to a tflite model to make it work in Mobile Devices. Is there any straight-forward way to find out how can I find what are the parameters I should use for input_arrays and output_arrays?
import tensorflow as tf
graph_def_file = "/path/to/Downloads/mobilenet_v1_1.0_224/frozen_graph.pb"
input_arrays = ["input"]
output_arrays = ["MobilenetV1/Predictions/Softmax"]
converter = tf.lite.TFLiteConverter.from_frozen_graph(
graph_def_file, input_arrays, output_arrays)
tflite_model = converter.convert()
open("converted_model.tflite", "wb").write(tflite_model)
tensorflow keras tensorflow-lite yolo
I need to convert my .pb tensorflow model together with my .cpkt file to a tflite model to make it work in Mobile Devices. Is there any straight-forward way to find out how can I find what are the parameters I should use for input_arrays and output_arrays?
import tensorflow as tf
graph_def_file = "/path/to/Downloads/mobilenet_v1_1.0_224/frozen_graph.pb"
input_arrays = ["input"]
output_arrays = ["MobilenetV1/Predictions/Softmax"]
converter = tf.lite.TFLiteConverter.from_frozen_graph(
graph_def_file, input_arrays, output_arrays)
tflite_model = converter.convert()
open("converted_model.tflite", "wb").write(tflite_model)
tensorflow keras tensorflow-lite yolo
tensorflow keras tensorflow-lite yolo
edited Mar 24 at 7:30
gameon67
1,345926
1,345926
asked Mar 23 at 21:12
DaniDani
103
103
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
According to the official docs here :
input_arrays: List of input tensors to freeze graph with.
output_arrays: List of output tensors to freeze graph with.
Meaning, input_arrays is the list of input tensors ( which are mostly placeholder tensors ). output_arrays is the list of Tensor objects which will act as outputs.
In your case, you are providing the name of the Tensor object. An actual Tensor object is required.
You can understand it with this example:
x1 = tf.placeholder( dtype=tf.float32 )
x2 = tf.placeholder( dtype=tf.float32 )
y = x1 + x2
input_arrays = [ x1 , x2 ]
output_arrays = [ y ]
You can learn to find the input and output tensors from here .
Seeing your code, it seems that you know the tensor names, so you can refer this answer.
So, you mean I must provide the tensors itself instead if the names? Thanks very much
– Dani
Mar 24 at 9:57
Yes. Provide the tensors and not their names. Also, accept the answer if it feels helpful.
– Shubham Panchal
Mar 24 at 10:38
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55318440%2fwhat-are-the-parameters-input-arrays-and-output-arrays-that-are-needed-to-conver%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
According to the official docs here :
input_arrays: List of input tensors to freeze graph with.
output_arrays: List of output tensors to freeze graph with.
Meaning, input_arrays is the list of input tensors ( which are mostly placeholder tensors ). output_arrays is the list of Tensor objects which will act as outputs.
In your case, you are providing the name of the Tensor object. An actual Tensor object is required.
You can understand it with this example:
x1 = tf.placeholder( dtype=tf.float32 )
x2 = tf.placeholder( dtype=tf.float32 )
y = x1 + x2
input_arrays = [ x1 , x2 ]
output_arrays = [ y ]
You can learn to find the input and output tensors from here .
Seeing your code, it seems that you know the tensor names, so you can refer this answer.
So, you mean I must provide the tensors itself instead if the names? Thanks very much
– Dani
Mar 24 at 9:57
Yes. Provide the tensors and not their names. Also, accept the answer if it feels helpful.
– Shubham Panchal
Mar 24 at 10:38
add a comment |
According to the official docs here :
input_arrays: List of input tensors to freeze graph with.
output_arrays: List of output tensors to freeze graph with.
Meaning, input_arrays is the list of input tensors ( which are mostly placeholder tensors ). output_arrays is the list of Tensor objects which will act as outputs.
In your case, you are providing the name of the Tensor object. An actual Tensor object is required.
You can understand it with this example:
x1 = tf.placeholder( dtype=tf.float32 )
x2 = tf.placeholder( dtype=tf.float32 )
y = x1 + x2
input_arrays = [ x1 , x2 ]
output_arrays = [ y ]
You can learn to find the input and output tensors from here .
Seeing your code, it seems that you know the tensor names, so you can refer this answer.
So, you mean I must provide the tensors itself instead if the names? Thanks very much
– Dani
Mar 24 at 9:57
Yes. Provide the tensors and not their names. Also, accept the answer if it feels helpful.
– Shubham Panchal
Mar 24 at 10:38
add a comment |
According to the official docs here :
input_arrays: List of input tensors to freeze graph with.
output_arrays: List of output tensors to freeze graph with.
Meaning, input_arrays is the list of input tensors ( which are mostly placeholder tensors ). output_arrays is the list of Tensor objects which will act as outputs.
In your case, you are providing the name of the Tensor object. An actual Tensor object is required.
You can understand it with this example:
x1 = tf.placeholder( dtype=tf.float32 )
x2 = tf.placeholder( dtype=tf.float32 )
y = x1 + x2
input_arrays = [ x1 , x2 ]
output_arrays = [ y ]
You can learn to find the input and output tensors from here .
Seeing your code, it seems that you know the tensor names, so you can refer this answer.
According to the official docs here :
input_arrays: List of input tensors to freeze graph with.
output_arrays: List of output tensors to freeze graph with.
Meaning, input_arrays is the list of input tensors ( which are mostly placeholder tensors ). output_arrays is the list of Tensor objects which will act as outputs.
In your case, you are providing the name of the Tensor object. An actual Tensor object is required.
You can understand it with this example:
x1 = tf.placeholder( dtype=tf.float32 )
x2 = tf.placeholder( dtype=tf.float32 )
y = x1 + x2
input_arrays = [ x1 , x2 ]
output_arrays = [ y ]
You can learn to find the input and output tensors from here .
Seeing your code, it seems that you know the tensor names, so you can refer this answer.
answered Mar 24 at 2:32
Shubham PanchalShubham Panchal
9051212
9051212
So, you mean I must provide the tensors itself instead if the names? Thanks very much
– Dani
Mar 24 at 9:57
Yes. Provide the tensors and not their names. Also, accept the answer if it feels helpful.
– Shubham Panchal
Mar 24 at 10:38
add a comment |
So, you mean I must provide the tensors itself instead if the names? Thanks very much
– Dani
Mar 24 at 9:57
Yes. Provide the tensors and not their names. Also, accept the answer if it feels helpful.
– Shubham Panchal
Mar 24 at 10:38
So, you mean I must provide the tensors itself instead if the names? Thanks very much
– Dani
Mar 24 at 9:57
So, you mean I must provide the tensors itself instead if the names? Thanks very much
– Dani
Mar 24 at 9:57
Yes. Provide the tensors and not their names. Also, accept the answer if it feels helpful.
– Shubham Panchal
Mar 24 at 10:38
Yes. Provide the tensors and not their names. Also, accept the answer if it feels helpful.
– Shubham Panchal
Mar 24 at 10:38
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55318440%2fwhat-are-the-parameters-input-arrays-and-output-arrays-that-are-needed-to-conver%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown