Use Object detection (Images) block

Hello,
I’m really interested in using Edge Impulse!

I want to use the ‘Object Detection (Images)’ block.
I create the Impulse design like
Image data (320 * 320, Squash) - Image (RGB) - Object Detection (Images) - Output features

But, I’ve got the error code.

  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/script_ops.py", line 247, in __call__
    return func(device, token, args)

  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/script_ops.py", line 135, in __call__
    ret = self._func(*args)

  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/autograph/impl/api.py", line 620, in wrapper
    return func(*args, **kwargs)

  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/dataset_ops.py", line 960, in generator_py_func
    values = next(generator_state.get_iterator(iterator_id.numpy()))

  File "./resources/libraries/ei_tensorflow/training.py", line 91, in gen
    raw_boxes = Y_values[ix]['boundingBoxes']

IndexError: invalid index to scalar variable.


	 [[{{node EagerPyFunc}}]] [Op:IteratorGetNext]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/train.py", line 240, in <module>
    main_function()
  File "/home/train.py", line 111, in main_function
    X_train, X_test, Y_train, Y_test, len(X_train), classes, classes_values)
  File "/home/train.py", line 49, in train_model
    train_dataset, validation_dataset)
  File "./resources/libraries/ei_tensorflow/object_detection.py", line 101, in train
    for batch in train_dataset:
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/iterator_ops.py", line 747, in __next__
    return self._next_internal()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/iterator_ops.py", line 739, in _next_internal
    return structure.from_compatible_tensor_list(self._element_spec, ret)
  File "/usr/lib/python3.6/contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/context.py", line 2116, in execution_mode
    executor_new.wait()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/executor.py", line 69, in wait
    pywrap_tfe.TFE_ExecutorWaitForAllPendingNodes(self._handle)
tensorflow.python.framework.errors_impl.UnknownError: IndexError: invalid index to scalar variable.
Traceback (most recent call last):

  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/script_ops.py", line 247, in __call__
    return func(device, token, args)

  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/script_ops.py", line 135, in __call__
    ret = self._func(*args)

  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/autograph/impl/api.py", line 620, in wrapper
    return func(*args, **kwargs)

  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/dataset_ops.py", line 960, in generator_py_func
    values = next(generator_state.get_iterator(iterator_id.numpy()))

  File "./resources/libraries/ei_tensorflow/training.py", line 91, in gen
    raw_boxes = Y_values[ix]['boundingBoxes']

IndexError: invalid index to scalar variable.


	 [[{{node EagerPyFunc}}]]

Application exited with code 1 (Error)`

I wonder to fix this error.

And hopefully may I get the .pdf file or some manual about the Impulse Block?

Hi @SunBeenMoon , sorry, this should not have been public yet which is why there’s no docs for this yet. The reason why you can’t train for this is that the labeling pipeline is still behind a flag, so there’s nothing to train here yet.

This is now hidden again, sorry for the inconvenience! We hope to have better news about availability soon :rocket:

2 Likes

oh Thank you for your update @janjongboom

Interested in awesome Edge Impulse!!

I’ll wait for update !! :grinning:

Hi @janjongboom.

Can I ask you one more question?

I wonder if the Regression Impulse block is not working for the same reason as above.

An error occurs when using the Regression Impulse block.

Same reason. It’s yet in development, and If I am not wrong the docs will be available in some days publicly. I am not really sure about this, @janjongboom knows everything. :))

Oh, Thank you for your reply @dhruvsheth :grinning:

I’ll wait for update!!

Hi @SunBeenMoon @dhruvsheth ,

Regression block is working, but you’ll need to have all your labels in your dataset be numeric. What error do you see?

Hi, I tried Regression block.

But I still have error.

My project number is 24990. Could you check it?

My data set is gestures dataset download from edge impulse docs.

@SunBeenMoon for regression all your labels need to be numeric. The regression block outputs a number, so the labels need to have it too. The gestures dataset won’t work for this.

Here’s an example project for regression (predicting values on a curve): https://studio.edgeimpulse.com/public/17972/latest

Thank you so much for your kind reply @janjongboom

I’ll try it!