cancel
Showing results for 
Search instead for 
Did you mean: 

NOT IMPLEMENTED: Shape with 1 dimensions not supported: (1,)?

JTedot
Associate II

I naively imported the well known [YAMNet](https://github.com/tensorflow/models/tree/master/research/audioset/yamnet) - .tflite version found [here](https://tfhub.dev/google/lite-model/yamnet/tflite/1) for audio classification to the X Cube AI analyzer. I expected it to run into a problem because of YAMNet's dynamic input size, which I would have fixed by converting a version of YAMNet with a fixed input size (number of samples), taking away its dynamic capabilities. What followed was a different error, which i didn't expect:

Neural Network Tools for STM32AI v1.5.1 (STM.ai v7.0.0-RC8) 
NOT IMPLEMENTED: Shape with 1 dimensions not supported: (1,)

Sorry for the provocative question; I'm not too familiar with the tf-vocabulary yet; but if a 1-D input is not supported, then what is? Only single values? This is quite confusing to me as a 1-D input seems the most useful and most used to me.

1 REPLY 1
jean-michel.d
ST Employee

Hi JTedot,

For coherence raison, default tflite Yamnet model embeds also the preprocessing stage of the raw audio samples to build the features to feed a "classical" deep network. This part is exported as a set of "basic" TFLite operators (Mul, Cell, Sub, Pad,...), this is in theory interesting for the end-user but to deploy it efficiently on the IoT target, this is a little bit challenging. It is recommended to use the specialized and more efficient libraries to compute the features and after to deploy/generate the next part. I have not checked, but I think that the original scripts to generate the whole model can be updated to generate only the second part and to extract the used parameters for the first part. Or your experimentation to fix the dynamic input size is correct (and recommended to deploy a model, dynamic input size is not supported) but don't forget the first batch dimension: (1, nb_samples) instead (nb_samples, ).

Concerning the "1-D" issue, X-CUBE-AI supports the 1-D tensor. The issue here is that the model has an input shape with only one dimension. X-CUBE-AI expects a minimum of 2 dimensions. First is considered as the batch dimension, for a 1D-tensor, the tools expects the input shape; (1, nb_features).

br,

Jean-Michel