2019-04-01 09:50 PM
Following is my data , I am trying to validate on option of 'validate on desktop'. I am getting following error
Loading: /home/censdata/workspace/har/har_ai/har_ai.ioc project
Initializing: STM32F429ZITx
[AI:network] Analyzing model
[AI:Generator] Command /home/censdata/STM32Cube/Repository/Packs/STMicroelectronics/X-CUBE-AI/3.4.0/Utilities/linux/generatecode --auto -c /tmp/mxAI227727002133516706206695419651859/config.ai
[AI:Generator] Python generation ended
[AI:network] Analyze and code generation complete on AI model
[AI:network] Starting AI validation on desktop with custom dataset : /home/censdata/stm_ai/HAR-CNN-Keras-master/data_compressed/data_3_Axis.txt...
[AI:Validator] Command /home/censdata/STM32Cube/Repository/Packs/STMicroelectronics/X-CUBE-AI/3.4.0/Utilities/linux/validate - -p /home/censdata/stm_ai/HAR-CNN-Keras-master/model.h5 -t keras_dump --compress 4 -i /home/censdata/stm_ai/HAR-CNN-Keras-master/data_compressed/data_3_Axis.txt
Matching results...
[AI:Validator] ValueError: cannot reshape array of size 5242880 into shape (1048576,90,3,1)
I am using keras model
2019-04-09 04:30 AM
Hi,
Thanks for the provided files. In your case the provided txt is not correctly formatted. As indicated in the UM (section14.2). The expected file (.csv or .txt extension) should be a simple txt file with one input tensor by line (flattened input tensor) and the comma is used as separator (There is not check in the CUBE-AI). With your file, numpy.genfromtxt() returns:
shape = (1048576, 5)
[[-0.6946377 12.680544 0.50395286 nan nan]
[ 5.012288 11.264028 0.95342433 nan nan]
[ 4.903325 10.882658 -0.08172209 nan nan]
...
which can be not reshaped after with the following function:
inputs = np.reshape(inputs, (len(inputs), ) + (90,3,1))
and the following Python erro is generated.
ValueError: cannot reshape array of size 5242880 into shape (1048576,90,3,1)
Correct syntax:
-0.6946377,12.680544,0.50395286,5.012288,11.264028,0.95342433...
...
Best Regards,
Jean-Michel
2019-04-24 03:35 AM
2020-02-20 05:28 AM
For people still having this problem, I had the same issue and I solved it by changing the value of _APP_DEBUG_ from 0 to 1 (defined in "aiValidation.c")
2021-07-09 06:24 AM
What is the document you are referring to?