Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

KNearestNeighbors can not be serialized #913

Closed
minhtdhktqs opened this issue Sep 28, 2017 · 3 comments
Closed

KNearestNeighbors can not be serialized #913

minhtdhktqs opened this issue Sep 28, 2017 · 3 comments
Milestone

Comments

@minhtdhktqs
Copy link

my code in VB.net:
Private k_n_n As KNearestNeighbors
I want to save it to a .txt file by this code:
Accord.IO.Serializer.Save(k_n_n, "KNN.txt")
but I got a error.

An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll
Additional information: Type 'Accord.Collections.BinaryNode1[[Accord.Collections.KDTreeNode1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], Accord.MachineLearning, Version=3.7.2.0, Culture=neutral, PublicKeyToken=fa1a88e29555ccf7]]' in Assembly 'Accord, Version=3.7.2.0, Culture=neutral, PublicKeyToken=fa1a88e29555ccf7' is not marked as serializable.

how to fix it? thanks

@cesarsouza
Copy link
Member

Hi @minhtdhktqs,

Thanks for opening the issue! It seems that the one of the classes that are part of KNearestNeighbors classifier is missing a [Serializable] attribute. This is going to be fixed in the next pre-release.

Regards,
Cesar

@cesarsouza cesarsouza changed the title KNearestNeighbors can not serializer KNearestNeighbors can not be serialized Sep 28, 2017
cesarsouza added a commit that referenced this issue Sep 28, 2017
 - Updates GH-913: KNearestNeighbors can not be serialized
@cesarsouza
Copy link
Member

Added in 3.8.0.

@cesarsouza cesarsouza added this to the 3.8 milestone Oct 21, 2017
@minhtdhktqs
Copy link
Author

minhtdhktqs commented Oct 24, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants