WASM Test run with failure ERR: -1004 (EIDSP_MATRIX_SIZE_MISMATCH)

Hi, My model worked in live classification test using both phone and test files. However, when I tried to run a deployment test with WASM, there was a matrix error. I’m not sure about the cause. Attached is the message with the error-code. Please help to check and advice for the probable causes. Thanks.

F:\Projects\EdgeImpulse\Project-1\WASM>node run-impulse.js “348, 194, 62, -53, -165, -282, -400, -511, -601, -667, -712, -746, -777, -814, …”
out_matrix = 1x611
calculated size = 17473x13
ERR: -1004 (EIDSP_MATRIX_SIZE_MISMATCH)
Assertion failed: false, at: edge-impulse-sdk/classifier/ei_run_dsp.h,267,extract_mfcc_features
Assertion failed: false, at: edge-impulse-sdk/classifier/ei_run_dsp.h,267,extract_mfcc_features
Failed to initialize classifier RuntimeError: abort(Assertion failed: false, at: edge-impulse-sdk/classifier/ei_run_dsp.h,267,extract_mfcc_features). Build with -s ASSERTIONS=1 for more info.
at abort (F:\Projects\EdgeImpulse\Project-1\WASM\edge-impulse-standalone.js:1:9556)
at __assert_fail (F:\Projects\EdgeImpulse\Project-1\WASM\edge-impulse-standalone.js:1:11963)
at :wasm-function[270]:0x12ef4
at :wasm-function[134]:0xa2b7
at :wasm-function[350]:0x1eb71
at :wasm-function[183]:0x102de
at L (:wasm-function[201]:0x10452)
at Module.dynCall_iiiii (F:\Projects\EdgeImpulse\Project-1\WASM\edge-impulse-standalone.js:1:55922)
at dynCall_iiiii_37 (eval at makeDynCaller (F:\Projects\EdgeImpulse\Project-1\WASM\edge-impulse-standalone.js:1:29826), :4:12)
at Object.run_classifier (eval at new
(F:\Projects\EdgeImpulse\Project-1\WASM\edge-impulse-standalone.js:1:35504), :10:10)

Hi @pvinhha,

The number of raw samples is probably incorrect. your model works fine on my side.

Can you check the number of raw features in argument? It should be 48000.

FYI you can copy raw features from the '‘Live Classification’ as shown below:

Aurelien

Hi Aurel, Thanks for this hint. I checked the pasting parameters and found that there was a problem that all data values were not pasted completely by the system. It is possible that the command line is too long with these 48000 added parameters. I tried to change some Windows consoles configurations, but it didn’t help. There’s also a problem with a batch file. Below is a snapshot for the pasting issue with incomplete data at the end. I’m thinking if these parameters can be saved in a csv text file, then the run-impulse.js can take in as an input file to parse for the data. This will help to solve the problem. Will this proposal be possible for a new feature? Please let me know. Thanks.

Hi @pvinhha,

Right Windows (actually linked to NTFS) has a limitation of 32k characters.
Features can be written in a csv, otherwise a simple thing is to copy all features directly in the run-impulse.js, you can modify it as follows:

classifier.init().then(() => {
    let raw = "121, 33, 434, 454, 545....."
    let result = classifier.classify(raw.trim().split(',').map(n => Number(n)));

Let me know if that works.

Aurelien

1 Like

Hi Aurel, yes, with the change of embedded feature raw string, it worked great. Thanks very much. Attached is a snapshot of the result.
image

1 Like

Great glad to hear @pvinhha!