profile
viewpoint

issue commenttensorflow/models

Data Augmentation Options are altered during training

Thank you for sharing your views!

twhitloc

comment created time in 13 days

issue commenttensorflow/models

Data Augmentation Options are altered during training

Sorry for the very basic question. If we apply data augmentation techniques such as ssd_random_crop and random_horizontal_flip than do we have to take care about ground truth bounding boxes? If we crop or flip image than the corresponding ground truth bounding box doesn't match. Is this managed by the tensorflow object detection API?

Thank you!

twhitloc

comment created time in 22 days

issue openedtensorflow/models

How to implement SSD with Resnet-50 for object detection

Hello,

I am using ssd_mobilenet_v2_coco for training object detection model on the custom dataset.

Is there any possibility to replace mobilenet architecture with Resnet-50 to train the object detector model? I couldn't find any guide to train SSD with Resnet-50 architecture in the official models i.e. Tensorflow detection model zoo.

Could you please guide me or provide me any pointer on "How to train SSD with Resnet-50 architecture on the custom dataset?"

Are you willing to contribute it? No (Unfortunately I don't have that much expertise)

Thank you!

created time in 22 days

issue openedstevefielding/tensorflow-anpr

Labeling using MTurk

Hi,

Thanks for sharing your interesting work.

Could you please elaborate more on Why you introduced MTurk for labeling (what's your intention)? There exists several open source labeling tool such as LabelImg, Labelme etc.

Can I directly achieve the same using LabelImg? I am planning to use 2 stage detector as you mentioned 1) detecting license plate and 2) recognizing digits/character.

Can you please elaborate more on 1 stage detector? How can you tell object detector to first detect license plate followed by recognizing? I am not getting this.

Please share your views!

Thanking you, Saurabh

created time in a month

issue openedcm107/annotation_utils

Polygon to rectangle bounding box

Hello,

I looked at your github profile and I realized that you have written several convert for Labelme to COCO. I know that we can generate oriented bounding box using polygon using labelme tool.

Do you know how to convert polygon bounding box to rectangle bounding box (you can find more information here:https://github.com/wkentaro/labelme/issues/542)? Do you have written any script for this type of converter?

Thanking you!

created time in 2 months

issue commentblue-yonder/tsfresh

How to use tsfresh with unsupervised learning

Thank you for the clarification!

chauhansaurabhb

comment created time in 2 months

issue openedblue-yonder/tsfresh

How to use tsfresh with unsupervised learning

Thanks for sharing this library.

I am looking to use this library with reference to unsupervised learning. I have one curve (time ~ value) and I have only three columns in dataset i.e. id, time, value (here I have day wise sum of values i.e. aggregated values) and would like to use this library to extract features followed by clustering techniques.

However, I can able to extract features but when I select optimal features using features_filtered = select_features(extracted_features, y) but how can I pass value of y? I don't have label column in my dataset.

Could you please elaborate more on "How to use tsfresh library for unsupervised learning?"

Thanking you!

created time in 2 months

issue closedtensorflow/tensorflow

Converting saved_model to TFLite model using TF 2.0

System information

  • Google colab:
  • TensorFlow 2.0.0

I am working on converting custom object detection model (trained using SSD and inception network) to quantized TFLite model. I can able to convert custom object detection model from frozen graph to quantized TFLite model using the following code snippet (using Tensorflow 1.4):

converter = tf.lite.TFLiteConverter.from_frozen_graph(args["model"],input_shapes = {'normalized_input_image_tensor':[1,300,300,3]},
input_arrays = ['normalized_input_image_tensor'],output_arrays = ['TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1',
'TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3'])

converter.allow_custom_ops=True
converter.post_training_quantize=True 
tflite_model = converter.convert()
open(args["output"], "wb").write(tflite_model)

However tf.lite.TFLiteConverter.from_frozen_graph class method is not available for Tensorflow 2.0 (refer this link). So I tried to convert the model using tf.lite.TFLiteConverter.from_saved_model class method. The code snippet is shown below:

converter = tf.lite.TFLiteConverter.from_saved_model("/content/") # Path to saved_model directory
converter.optimizations =  [tf.lite.Optimize.DEFAULT]
tflite_model = converter.convert()

The above code snippet throws the following error:

ValueError: None is only supported in the 1st dimension. Tensor 'image_tensor' has invalid shape '[None, None, None, 3]'.

I tried to pass input_shapes as argument

converter = tf.lite.TFLiteConverter.from_saved_model("/content/",input_shapes={"image_tensor" : [1,300,300,3]})

but it throws the following error:

TypeError: from_saved_model() got an unexpected keyword argument 'input_shapes'

Am I missing something? Please feel free to correct me!

closed time in 3 months

chauhansaurabhb

issue commenttensorflow/tensorflow

Converting saved_model to TFLite model using TF 2.0

Thanks for the pointer! I got it using tf.compat.v1.lite.TFLiteConverter.from_frozen_graph.

chauhansaurabhb

comment created time in 3 months

issue commenttensorflow/tensorflow

Converting saved_model to TFLite model using TF 2.0

As mentioned in the question, I can able to convert a tensorflow object detection model to tflite model using tf.lite.TFLiteConverter.from_frozen_graph class method but this class method is not available for Tensorflow 2.0. I want to use tensorflow 2.0 for this.

chauhansaurabhb

comment created time in 3 months

issue commenttensorflow/tensorflow

Converting saved_model to TFLite model using TF 2.0

@gargn : Thanks for the detailed explanation. I followed the explanation given by you. However, I am getting the error:

saved_model_dir='/content/'
saved_model_obj = tf.saved_model.load(export_dir=saved_model_dir)
concrete_func = saved_model_obj.signatures['serving_default']
print(concrete_func.structured_outputs)

The output of the above print seems to be fine:

{'detection_boxes': <tf.Tensor 'detection_boxes:0' shape=(None, 100, 4) dtype=float32>, 'raw_detection_boxes': <tf.Tensor 'raw_detection_boxes:0' shape=(None, None, 4) dtype=float32>, 'detection_scores': <tf.Tensor 'detection_scores:0' shape=(None, 100) dtype=float32>, 'raw_detection_scores': <tf.Tensor 'raw_detection_scores:0' shape=(None, None, 4) dtype=float32>, 'detection_multiclass_scores': <tf.Tensor 'detection_multiclass_scores:0' shape=(None, 100, 4) dtype=float32>, 'detection_classes': <tf.Tensor 'detection_classes:0' shape=(None, 100) dtype=float32>, 'num_detections': <tf.Tensor 'num_detections:0' shape=(None,) dtype=float32>}

Setting the shape:

concrete_func.inputs[0].set_shape([None,300,300,3]) # I also tried with [1,300,300,3]

And finally converted the model to tflite model:

converter =  tf.lite.TFLiteConverter.from_concrete_functions([concrete_func])
converter.optimizations =  [tf.lite.Optimize.DEFAULT]
tflite_model = converter.convert()

It throws the following error:

---------------------------------------------------------------------------
ConverterError                            Traceback (most recent call last)
<ipython-input-31-70c5da23dc1d> in <module>()
      1 converter =  tf.lite.TFLiteConverter.from_concrete_functions([concrete_func])
      2 converter.optimizations =  [tf.lite.Optimize.DEFAULT]
----> 3 tflite_model = converter.convert()

2 frames
/usr/local/lib/python3.6/dist-packages/tensorflow_core/lite/python/convert.py in toco_convert_protos(model_flags_str, toco_flags_str, input_data_str, debug_info_str, enable_mlir_converter)
    198       stdout = _try_convert_to_unicode(stdout)
    199       stderr = _try_convert_to_unicode(stderr)
--> 200       raise ConverterError("See console for info.\n%s\n%s\n" % (stdout, stderr))
    201   finally:
    202     # Must manually cleanup files.

ConverterError: See console for info.
2020-01-14 08:34:56.050487: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.050574: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.050592: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.050611: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.050684: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.050710: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.050723: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.050735: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.050746: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.050759: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.050769: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.050780: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.050795: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.050804: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.050814: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.050823: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.050833: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayScatterV3
2020-01-14 08:34:56.050847: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.050859: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.050868: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.050891: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.050906: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: LoopCond
2020-01-14 08:34:56.050927: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Exit
2020-01-14 08:34:56.050942: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Exit
2020-01-14 08:34:56.050952: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArraySizeV3
2020-01-14 08:34:56.050963: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayReadV3
2020-01-14 08:34:56.050988: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArraySizeV3
2020-01-14 08:34:56.051008: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayWriteV3
2020-01-14 08:34:56.051022: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayGatherV3
2020-01-14 08:34:56.051043: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayGatherV3
2020-01-14 08:34:56.051066: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayWriteV3
2020-01-14 08:34:56.051760: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.051792: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.051806: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.051820: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.051832: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.051843: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.051855: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.051866: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.051903: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.051915: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.051927: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.051937: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.051948: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.051962: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.051972: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.051984: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.051994: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052005: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.052015: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052026: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayV3
2020-01-14 08:34:56.052036: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052052: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052070: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052080: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052090: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052100: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052111: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayScatterV3
2020-01-14 08:34:56.052123: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052133: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052144: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052155: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052165: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayScatterV3
2020-01-14 08:34:56.052177: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052188: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052198: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052208: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052219: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayScatterV3
2020-01-14 08:34:56.052243: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052256: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052268: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052278: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052290: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052300: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052311: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052322: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052332: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052343: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052354: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052364: I tensorflow/lite/toco/import_tensorflow.cc:193] Unsupported data type in placeholder op: 20
2020-01-14 08:34:56.052376: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayScatterV3
2020-01-14 08:34:56.052393: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052411: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052437: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052469: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.052488: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: LoopCond
2020-01-14 08:34:56.052553: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Exit
2020-01-14 08:34:56.052571: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Exit
2020-01-14 08:34:56.052585: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Exit
2020-01-14 08:34:56.052597: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Exit
2020-01-14 08:34:56.052610: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Exit
2020-01-14 08:34:56.052629: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayReadV3
2020-01-14 08:34:56.052643: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayReadV3
2020-01-14 08:34:56.052656: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayReadV3
2020-01-14 08:34:56.052668: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayReadV3
2020-01-14 08:34:56.053081: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArraySizeV3
2020-01-14 08:34:56.053100: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArraySizeV3
2020-01-14 08:34:56.053113: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArraySizeV3
2020-01-14 08:34:56.053124: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArraySizeV3
2020-01-14 08:34:56.053134: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArraySizeV3
2020-01-14 08:34:56.053207: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayScatterV3
2020-01-14 08:34:56.053234: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayGatherV3
2020-01-14 08:34:56.053248: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayGatherV3
2020-01-14 08:34:56.053261: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayGatherV3
2020-01-14 08:34:56.053273: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayGatherV3
2020-01-14 08:34:56.053285: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayGatherV3
2020-01-14 08:34:56.053298: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Enter
2020-01-14 08:34:56.053319: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayReadV3
2020-01-14 08:34:56.053405: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: NonMaxSuppressionV3
2020-01-14 08:34:56.053428: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: NonMaxSuppressionV3
2020-01-14 08:34:56.053441: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: NonMaxSuppressionV3
2020-01-14 08:34:56.053529: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Size
2020-01-14 08:34:56.053627: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: Size
2020-01-14 08:34:56.053674: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayWriteV3
2020-01-14 08:34:56.053782: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayWriteV3
2020-01-14 08:34:56.053797: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayWriteV3
2020-01-14 08:34:56.053814: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayWriteV3
2020-01-14 08:34:56.053825: I tensorflow/lite/toco/import_tensorflow.cc:659] Converting unsupported operation: TensorArrayWriteV3
2020-01-14 08:34:56.070797: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before Removing unused ops: 816 operators, 1530 arrays (0 quantized)
2020-01-14 08:34:56.106869: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] After Removing unused ops pass 1: 809 operators, 1514 arrays (0 quantized)
2020-01-14 08:34:56.146313: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before general graph transformations: 809 operators, 1514 arrays (0 quantized)
2020-01-14 08:34:56.201644: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] After general graph transformations pass 1: 548 operators, 1070 arrays (0 quantized)
2020-01-14 08:34:56.216716: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before Group bidirectional sequence lstm/rnn: 548 operators, 1070 arrays (0 quantized)
2020-01-14 08:34:56.230809: I tensorflow/lite/toco/graph_transformations/graph_transformations.cc:39] Before dequantization graph transformations: 548 operators, 1070 arrays (0 quantized)
2020-01-14 08:34:56.253590: I tensorflow/lite/toco/allocate_transient_arrays.cc:345] Total transient array allocated size: 1080704 bytes, theoretical optimal value: 1080704 bytes.
2020-01-14 08:34:56.256625: F tensorflow/lite/toco/tooling_util.cc:2275] Check failed: array.data_type == array.final_data_type Array "image_tensor" has mis-matching actual and final data types (data_type=uint8, final_data_type=float).
Fatal Python error: Aborted

Current thread 0x00007fbd1dc0f780 (most recent call first):
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/lite/toco/python/toco_from_protos.py", line 52 in execute
  File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 250 in _run_main
  File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 299 in run
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/platform/app.py", line 40 in run
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/lite/toco/python/toco_from_protos.py", line 89 in main
  File "/usr/local/bin/toco_from_protos", line 8 in <module>
Aborted (core dumped)

Could you please guide me?

chauhansaurabhb

comment created time in 3 months

issue openedtzutalin/labelImg

Oriented bounding boxes

I am looking for a tool which draws oriented bounding box across an object. As in the real-world scenario, most of the times objects are oriented.

I am familiar with this tool and verified from my side that it is not possible to draw oriented bounding box (please feel free to correct me, If I am wrong). However, I came to know about another labeling tool which is forked from this tool.

As written in the above URL that it draws oriented bounding box so I would like to make sure whether it is possible to draw oriented bounding boxes using this original tool or not.

Thanking you!

created time in 3 months

issue commenttensorflow/tensorflow

Converting saved_model to TFLite model using TF 2.0

Thanks for the kind response. Could you please provide more information?

I tried the following code so far:

reloaded = tf.saved_model.load(export_dir="/content/")
cf = reloaded.signatures
cf.input_shapes = {'image_tensor':[1,300,300,3]}
converter =  tf.lite.TFLiteConverter.from_concrete_functions(reloaded)
converter.optimizations =  [tf.lite.Optimize.DEFAULT]
tflite_model = converter.convert()

Got the following error:

TypeError                                 Traceback (most recent call last)
<ipython-input-13-86ab3b34a7ae> in <module>()
----> 1 converter =  tf.lite.TFLiteConverter.from_concrete_functions(reloaded)
      2 
      3 converter.optimizations =  [tf.lite.Optimize.DEFAULT]
      4 tflite_model = converter.convert()

/usr/local/lib/python3.6/dist-packages/tensorflow_core/lite/python/lite.py in from_concrete_functions(cls, funcs)
    326       Invalid input type.
    327     """
--> 328     for func in funcs:
    329       if not isinstance(func, _function.ConcreteFunction):
    330         message = "This function takes in a list of ConcreteFunction."

TypeError: 'AutoTrackable' object is not iterable

I am very new to this tensorflow 2.0. Could you please guide me?

chauhansaurabhb

comment created time in 3 months

issue commentwkentaro/labelme

How to generate Pascal VOC format dataset

Thanks for the pointer. Let me try!

chauhansaurabhb

comment created time in 3 months

issue commentwkentaro/labelme

How to generate Pascal VOC format dataset

Thanks for the kind response. But I looked at the suggested link. In that case, it doesn't generate oriented bounding box. I am at beginner level (I may be wrong). Please feel free to correct me!

chauhansaurabhb

comment created time in 3 months

issue openedtensorflow/tensorflow

Converting saved_model to TFLite model using TF 2.0

System information

  • Google colab:
  • TensorFlow 2.0.0

I am working on converting custom object detection model (trained using SSD and inception network) to quantized TFLite model. I can able to convert custom object detection model from frozen graph to quantized TFLite model using the following code snippet (using Tensorflow 1.4):

converter = tf.lite.TFLiteConverter.from_frozen_graph(args["model"],input_shapes = {'normalized_input_image_tensor':[1,300,300,3]},
input_arrays = ['normalized_input_image_tensor'],output_arrays = ['TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1',
'TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3'])

converter.allow_custom_ops=True
converter.post_training_quantize=True 
tflite_model = converter.convert()
open(args["output"], "wb").write(tflite_model)

However tf.lite.TFLiteConverter.from_frozen_graph class method is not available for Tensorflow 2.0 (refer this link). So I tried to convert the model using tf.lite.TFLiteConverter.from_saved_model class method. The code snippet is shown below:

converter = tf.lite.TFLiteConverter.from_saved_model("/content/") # Path to saved_model directory
converter.optimizations =  [tf.lite.Optimize.DEFAULT]
tflite_model = converter.convert()

The above code snippet throws the following error:

ValueError: None is only supported in the 1st dimension. Tensor 'image_tensor' has invalid shape '[None, None, None, 3]'.

I tried to pass input_shapes as argument

converter = tf.lite.TFLiteConverter.from_saved_model("/content/",input_shapes={"image_tensor" : [1,300,300,3]})

but it throws the following error:

TypeError: from_saved_model() got an unexpected keyword argument 'input_shapes'

created time in 3 months

IssuesEvent

issue commentwkentaro/labelme

How to generate Pascal VOC format dataset

I modified the code but still it draws straight rectangle. For example, I labelled the following image using labelme (Image credits: google images):

test

I converted it to voc format using the modified labelme2voc.py script and I got the following output: test-1

Modified code snippet:

# if shape['shape_type'] != ('rectangle' or 'polygon'):
#     print('Skipping shape: label={label}, shape_type={shape_type}'
#           .format(**shape))
#     continue
class_name = shape['label']
class_id = class_names.index(class_name)
if shape['shape_type'] == 'rectangle':
    (xmin, ymin), (xmax, ymax) = shape['points']
elif shape['shape_type'] == 'polygon':
    (xmin, ymin),(_,_),(xmax, ymax),(_,_)  = shape['points']
# swap if min is larger than max. ```

Could you please guide me?
chauhansaurabhb

comment created time in 3 months

issue commentwkentaro/labelme

How to generate Pascal VOC format dataset

As you suggested the link, using that link it writes only rectangle to .xml file and skips the other shapes due to this code: if shape['shape_type'] != 'rectangle': How can I write polygon bounding boxes to .xml file?

chauhansaurabhb

comment created time in 3 months

issue closedwkentaro/labelme

How to generate Pascal VOC format dataset

Hello,

I was used to labelimg tool but I noticed that labelimg tool is not suitable when object is not straight forward and labelimg doesn't allow to rotate bounding box.

Thanks for sharing this tool. This tool generates .json file as output but for object detection using tensorflow, I need Pascal VOC format output file i.e. .xml file.

Is it possible to get bounding box and label related information in .xml file i.e. Pascal VOC format?

Thank you!

closed time in 3 months

chauhansaurabhb

issue commentwkentaro/labelme

How to generate Pascal VOC format dataset

Thanks for the quick response!

chauhansaurabhb

comment created time in 3 months

issue openedwkentaro/labelme

How to generate Pascal VOC format dataset

Hello,

I was used to labelimg tool but I noticed that labelimg tool is not suitable when object is not straight forward and labelimg doesn't allow to rotate bounding box.

Thanks for sharing this tool. This tool generates .json file as output but for object detection using tensorflow, I need Pascal VOC format output file i.e. .xml file.

Is it possible to get bounding box and label related information in .xml file i.e. Pascal VOC format?

Thank you!

created time in 3 months

issue commenttensorflow/tfjs

FrozenModel does not contain control flow or dynamic shape ops when using executeAsync()

@nsthorat : I am getting the following output after running a object detection in tensorflow.js but I am not getting the output. Could you please help me to interpret the output?

(4) [t, t, t, t] 0: t dataId: {} dtype: "float32" id: 1480 isDisposed: (...) isDisposedInternal: false kept: false rank: (...) rankType: "3" scopeId: 2240 shape: (3) [1, 100, 4] size: 400 strides: (2) [400, 4] __proto__: Object 1: t dataId: {} dtype: "float32" id: 1481 isDisposed: (...) isDisposedInternal: false kept: false rank: (...) rankType: "2" scopeId: 2242 shape: (2) [1, 100] size: 100 strides: [100] __proto__: Object 2: t dataId: {} dtype: "float32" id: 1479 isDisposed: (...) isDisposedInternal: false kept: false rank: (...) rankType: "2" scopeId: 2238 shape: (2) [1, 100] size: 100 strides: [100] __proto__: Object 3: t dataId: {} dtype: "float32" id: 1477 isDisposed: (...) isDisposedInternal: false kept: false rank: (...) rankType: "1" scopeId: 2234 shape: [1] size: 1 strides: [] __proto__: Object length: 4 __proto__: Array(0)

Here is the code of index.js file: `let model; const webcam = new Webcam(document.getElementById('wc')); let isPredicting = false;

async function init(){ try { await webcam.setup(); model = await tf.loadGraphModel('http://127.0.0.1:8887/model/model.json'); } catch (err) { console.log(err); } }

async function predict() { const img = webcam.capture(); console.log("executing model"); output = await model.executeAsync(img); console.log(output); }

init()

function startPredicting(){ isPredicting = true; predict(); }

function stopPredicting(){ isPredicting = false; predict(); }`

index.js

Code of inference.html file: `<html> <head> <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest"> </script> <script src="webcam.js"></script> </head> <body> <div> <div> <video autoplay playsinline muted id="wc" width="224" height="224"></video> </div> </div> <button type="button" id="startPredicting" onclick="startPredicting()" >Start Predicting</button> <button type="button" id="stopPredicting" onclick="stopPredicting()" >Stop Predicting</button> <div id="prediction"></div> </body>

<script src="index.js"></script> </html> `

Pravez

comment created time in 3 months

issue commenttensorflow/tensorflow

tf.lite.TFLiteConverter.from_frozen_graph error

@chenyuZha : Thanks for the solution. If anyone is looking for how to get the value of input_shapes, input_arrays and output_arrays then kindly upload your tflite graph to the this link and you will find all parameters value.

harsh020goyal

comment created time in 3 months

issue commenttensorflow/tensorflow

UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [Op:Conv2D]

@dayangkunurfaizah please try with the following settings:

from tensorflow.compat.v1.keras.backend import set_session
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True  # dynamically grow the memory used on the GPU
config.log_device_placement = True  # to log device placement (on which device the operation ran)
sess = tf.compat.v1.Session(config=config)
set_session(sess)
kernelizd

comment created time in 4 months

issue commenttensorflow/tensorflow

Error : Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.

@Cilicili please try with the below settings:

from tensorflow.compat.v1.keras.backend import set_session
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True  # dynamically grow the memory used on the GPU
config.log_device_placement = True  # to log device placement (on which device the operation ran)
sess = tf.compat.v1.Session(config=config)
set_session(sess)

I was facing the similar problem. When you run your code it occupies all memory of GPU and with the above provided settings it should work.

deepakrai9185720

comment created time in 4 months

issue openedGreenWaves-Technologies/gap_sdk

Scope of NNTOOL

Hello,

I am looking for the scope of the NNTOOL. I tried to transfer/deploy SSD tensorflow lite model and Facenet Keras model using facenet.h5 file but both didn't work. It seems that corresponding functions (i.e. kernals) are not implemented.

Could you please provide me the scope of the NNTOOL or pointer? What kind of model can I deploy on the edge device? How can I perform only inference using the pre-trained model using gap_sdk?

How can I realize the face recognition or object detection (using SSD) application using gap_sdk?

Thanking you!

created time in 4 months

issue closedgraham0/ginlong-wifi

Reading Inverter data through Raspberry Pi

I am trying to read data through Raspberry Pi instead of using the ginlong-wifi module. I tried with RS485 to USB serial converter and RS485 to TTL converter along with Modbus protocol and serial communication to read the data from Inverter.

I got the following response from the inverter that: [Input/Output] No Response received from the remote unit and could not able to read the data.

I would be happy if you can share your views on the above.

Looking for the swift response!

Thanking you, Saurabh

closed time in 4 months

chauhansaurabhb

issue commentbenjafire/CozmoGestureRegonize

Not able to extract Jester dataset!

I am facing the same issue. In my case, I am getting the error as the downloaded file extension is not tar.gz. Can't able to extract Jester dataset either on windows or in google colab.

Can you please guide @benjafire me?

Thanking you!

Sharma-Prachi

comment created time in 6 months

issue openedvictordibia/handtracking

How can I use this model in Keras?

Hello @victordibia,

Thanks for sharing your work. I would like first detect hand in an image, resize image and save it. Then, I would like to apply CNN to classify hand digit.

Could you please guide me how can I use your model in Keras?

Thanking you, Saurabh

created time in 6 months

more