LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Machine learning toolkit - KNN error 91

Solved!
Go to solution

Hello, 

I am currently using MLT for KNN classification and I get an error: Error 91 occurred at Variant To Data in NILabs_MLT.lvlib:ml_Distance_L1 Norm.vi:280001->Test_KNN.vi .. 

Possible reason(s):

LabVIEW: The data type of the variant is not compatible with the data type wired to the type input.

 

Although my inputs are of type variant! Attached 2 snapshots of the vi and the vi itself.

 

Please help me, its really urgent.

Download All
Message 1 of 8
(5,680 Views)
Solution
Accepted by topic author T2dei

It looks like the variant data type you are trying to use is actually a 2-D array of doubles and by wiring in a cluster of 1-D double arrays to the variant-to-data type sub-VI it throws an error for type mismatch. Try changing the data type your variant is converting to to a 2-D double array

Message 2 of 8
(5,621 Views)

Hello everyone !!!

 

I am getting the same error: "The data type of the variant is not compatible with the data type wired to the type input" while using k-NN. But i am not getting the suggested solution in the preceding thread. I am stuck here. Please elaborate the suggestion.

 

Thanks & best regards !

 

 

 

0 Kudos
Message 3 of 8
(5,329 Views)

LabVIEW is very particular about data types and data flow. In your block diagram, press Ctrl+H and use your mouse to hover over the data wires that are leading to where the error is being thrown. Make sure that the data types make sense and completely match. For example, in the previous person's post, a cluster of two 1-D arrays would throw this error when a 2-D array is expected. Look for things like that

0 Kudos
Message 4 of 8
(5,301 Views)

Sir thanks for the elaboration !

 

But i couldn't solve the problem. Still, i am in same mess. VI is attached. Also the file in which error is coming, is attached. I believe we can't do any change in ml_Distance_L2 Norm.vi , as that is stored in program files-machine learning. So where am i doing wrong in my VI (query.vi). 

 

Please suggest something. 

 

Thanks & best regards !!!

 

 

 
 
Download All
0 Kudos
Message 5 of 8
(5,284 Views)

With reference to above post,

 

I have now wired in 'cluster of 2-D double arrays' to the 'type' input of variant-to-data subvi. But still it is showing the same error. Please suggest something. 

 

Thanks !!!

0 Kudos
Message 6 of 8
(5,246 Views)
To me, it was much easier to create my own IP of KNN. Solving this error is time consuming and KNN is easy to program.

Good luck
0 Kudos
Message 7 of 8
(5,236 Views)

I am new guy for using labview and i am trap on the KNN VI.  i am not understand what is class label suppose to input. can any one give some idea,pls

0 Kudos
Message 8 of 8
(3,167 Views)