Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. import tensorflow as tf
  2. tf.enable_eager_execution()
  3. saved_model_dir = 'inference_graph/saved_model/'
  4. converter = tf.contrib.lite.TFLiteConverter.from_saved_model(saved_model_dir,input_arrays=input_arrays,output_arrays=output_arrays,input_shapes={"image_tensor": [1, 832, 832, 3]})
  5. converter.post_training_quantize = True
  6.  
  7. INFO:tensorflow:Saver not created because there are no variables in the graph to restore
  8. INFO:tensorflow:The specified SavedModel has no variables; no checkpoints were restored.
  9. INFO:tensorflow:The given SavedModel MetaGraphDef contains SignatureDefs with the following keys: {'serving_default'}
  10. INFO:tensorflow:input tensors info:
  11. INFO:tensorflow:Tensor's key in saved_model's tensor_map: inputs
  12. INFO:tensorflow: tensor name: image_tensor:0, shape: (-1, -1, -1, 3), type: DT_UINT8
  13. INFO:tensorflow:output tensors info:
  14. INFO:tensorflow:Tensor's key in saved_model's tensor_map: num_detections
  15. INFO:tensorflow: tensor name: num_detections:0, shape: (-1), type: DT_FLOAT
  16. INFO:tensorflow:Tensor's key in saved_model's tensor_map: detection_boxes
  17. INFO:tensorflow: tensor name: detection_boxes:0, shape: (-1, 100, 4), type: DT_FLOAT
  18. INFO:tensorflow:Tensor's key in saved_model's tensor_map: detection_scores
  19. INFO:tensorflow: tensor name: detection_scores:0, shape: (-1, 100), type: DT_FLOAT
  20. INFO:tensorflow:Tensor's key in saved_model's tensor_map: detection_classes
  21. INFO:tensorflow: tensor name: detection_classes:0, shape: (-1, 100), type: DT_FLOAT
  22. INFO:tensorflow:Saver not created because there are no variables in the graph to restore
  23. INFO:tensorflow:The specified SavedModel has no variables; no checkpoints were restored.
  24. INFO:tensorflow:Froze 0 variables.
  25. INFO:tensorflow:Converted 0 variables to const ops.
  26.  
  27. tflite_quantized_model = converter.convert()
  28.  
  29. ---------------------------------------------------------------------------
  30. RuntimeError Traceback (most recent call last)
  31. <ipython-input-6-61a136476642> in <module>
  32. ----> 1 tflite_quantized_model = converter.convert()
  33.  
  34. ~/.local/lib/python3.5/site-packages/tensorflow/contrib/lite/python/lite.py in convert(self)
  35. 451 input_tensors=self._input_tensors,
  36. 452 output_tensors=self._output_tensors,
  37. --> 453 **converter_kwargs)
  38. 454 else:
  39. 455 # Graphs without valid tensors cannot be loaded into tf.Session since they
  40.  
  41. ~/.local/lib/python3.5/site-packages/tensorflow/contrib/lite/python/convert.py in toco_convert_impl(input_data, input_tensors, output_tensors, *args, **kwargs)
  42. 340 data = toco_convert_protos(model_flags.SerializeToString(),
  43. 341 toco_flags.SerializeToString(),
  44. --> 342 input_data.SerializeToString())
  45. 343 return data
  46. 344
  47.  
  48. ~/.local/lib/python3.5/site-packages/tensorflow/contrib/lite/python/convert.py in toco_convert_protos(model_flags_str, toco_flags_str, input_data_str)
  49. 133 else:
  50. 134 raise RuntimeError("TOCO failed see console for info.n%sn%sn" %
  51. --> 135 (stdout, stderr))
  52. 136
  53. 137
  54.  
  55. RuntimeError: TOCO failed see console for info.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement