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

Toco not working for Tensorflow 1.9 #68

Closed
PoojaB26 opened this issue Jul 12, 2018 · 6 comments
Closed

Toco not working for Tensorflow 1.9 #68

PoojaB26 opened this issue Jul 12, 2018 · 6 comments

Comments

@PoojaB26
Copy link

Ubuntu : 16.0.4
Tensorflow : 1.9

I was trying the last step in this codelab ->
https://codelabs.developers.google.com/codelabs/tensorflow-for-poets-2-tflite/index.html#2

toco \ --input_file=tf_files/retrained_graph.pb \ --output_file=tf_files/optimized_graph.lite \ --input_format=TENSORFLOW_GRAPHDEF \ --output_format=TFLITE \ --input_shape=1,${IMAGE_SIZE},${IMAGE_SIZE},3 \ --input_array=input \ --output_array=final_result \ --inference_type=FLOAT \ --input_data_type=FLOAT

And this would throw an error: --graph_def_file, --saved_model_dir is required.

Read another issue where TOCO doesnt work for 1.8, I guess the issue is still not resolved for 1.9
Works fine with 1.7 though.

@ghost
Copy link

ghost commented Jul 17, 2018

Same here if changed --input_files to --graph_def_files then it just shows error:

@tigrandev
Copy link

tigrandev commented Jul 20, 2018

Try this one

toco \
  --graph_def_file=tf_files/retrained_graph.pb \
  --output_file=tf_files/optimized_graph.lite \
  --output_format=TFLITE \
  --input_shape=1,${IMAGE_SIZE},${IMAGE_SIZE},3 \
  --input_array=input \
  --output_array=final_result \
  --inference_type=FLOAT \
  --inference_input_type=FLOAT

@SagarSharma4244
Copy link

It works for me @tigrandev
Actually, for Tensorflow 1.9 you are supposed to change the --input_file to graph_def_file and not include the --input_format=TENSORFLOW_GRAPHDEF
But It is not updated in the Codelabs's TFLite Tutorial

@SagarSharma4244
Copy link

@PoojaB26 You can close the Issue if you want.

@PoojaB26
Copy link
Author

@SagarSharma4244 I'll try it out, thanks.

@abumubarak-dev
Copy link

@tigrandev what is the value of input_shape

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants