Skip to main content
MSant.11
Associate III
September 12, 2021
Solved

Warning error in ASC training script. AI Resources from FP-AI-SENSING1

  • September 12, 2021
  • 16 replies
  • 3172 views

I'm running your acoustic_scene_classification.ipynb, available in FP-AI-SENSING1, the Middleware ASC (acoustic scene classification):

https://www.st.com/en/embedded-software/fp-ai-sensing1.html

When I try to import and convert data, I get the following error warning:

---------------------------------------------------------------------------

OSError Traceback (most recent call last)

<ipython-input-9-87cd88dbb12e> in <module>

1 dataset_dir = './Dataset'

2 meta_path = path = os.path.join(dataset_dir, 'TrainSet.txt')

----> 3 fileset = np.loadtxt(meta_path, dtype=str)

4

5 # 3 classes : 0 indoor, 1 outdoor, 2 in-vehicle

C:\ST\Anaconda3\lib\site-packages\numpy\lib\npyio.py in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin, encoding, max_rows, like)

1063 raise ValueError("Wrong number of columns at line %d"

1064 % line_num)

-> 1065

1066 # Convert each value according to its column and store

1067 items = [conv(val) for (conv, val) in zip(converters, vals)]

C:\ST\Anaconda3\lib\site-packages\numpy\lib\_datasource.py in open(path, mode, destpath, encoding, newline)

192 """

193

--> 194 ds = DataSource(destpath)

195 return ds.open(path, mode, encoding=encoding, newline=newline)

196

C:\ST\Anaconda3\lib\site-packages\numpy\lib\_datasource.py in open(self, path, mode, encoding, newline)

529 _fname, ext = self._splitzipext(found)

530 if ext == 'bz2':

--> 531 mode.replace("+", "")

532 return _file_openers[ext](found, mode=mode,

533 encoding=encoding, newline=newline)

OSError: ./Dataset\TrainSet.txt not found.

....................................................................................................................

TrainSet.tx is inside the Dataset folder, as you settled.

Did you fix this issue ?

Thanks

    This topic has been closed for replies.
    Best answer by Laurent

    then maybe the versions are not compatible with one another, you should install older versions it should work . this pack was developed ages ago ...

    16 replies

    Laurent
    ST Employee
    September 24, 2021

    the main reason is that framing was the best trade off between model accuracy and RAM footprint on the platform implementation. Increasing the number of columns (to cover longer time slices) leads to -> bigger spectrograms -> bigger input to the NN -> more trainables -> bigger RAM footprint.

    MSant.11
    MSant.11Author
    Associate III
    September 24, 2021

    If I work with 5- second time waves, should I decrease the number of columns ? E.g. from your 32 to 10 ?​

    Laurent
    ST Employee
    September 24, 2021

    This can be an option to minimize the input shape size of the CNN network

    but You would need also to retrain the model provided with your data set

    let me know your findings !

    MSant.11
    MSant.11Author
    Associate III
    October 28, 2021

    Well, I left the number of columns at 32 in my model with a dataset of 74 sounds, each one long 5 seconds. Each mel-spectrogram covers 1,024 sec in this way. I have now my TFlite file and the inference runs in my CPU too.

    I have a NUCLEO -F401RE board coupled with an X-NUCLEO-CCA02M2 and the audio streaming example from MEMSMIC1.

    Is there a template for classifying audio streaming with the NN ?

    Thank you !

    Laurent
    ST Employee
    November 2, 2021

    hello

    What type of template are you referring to ? The FP already provides a NN that classifies audio streaming data.

    Of course this is not a template per say, but you can use it to derive your own example with your own data set and your own NN or ML.

    best regards

    L

    MSant.11
    MSant.11Author
    Associate III
    November 28, 2021

    Did you ever prepare a guideline like this one https://wiki.st.com/stm32mcu/wiki/AI:How_to_perform_motion_sensing_on_STM32L4_IoTnode but for ASC ?

    I have my own two-classes NN, keras model and the B-L475E-IOT01.

    Thanks

    M