Using Kryo to serialize a Spark mllib model - serialization

I want to serialize a model which is generate from ML lib Classifacation Tree,
A model is construct by a Node and a Algo, Node seems serializable
Can we just serialize a whole model to disk and read from another class to get the model back?
Thanks

Related

Why do we need to define MicroMutableOpResolver or AllOpsResolver for a particular model before calling an MicroInterpreter in tensorflow-lite?

I am currently trying to build a tflite model for a microcontroller. While creating the test file I came across a peice of code where in the test file was using a MicroMutableOpResolver to load model architecture. But I had already included the c dump of the model in my code then why is it using the resolver? Is it that the C dump of the model doesn't have any information of model architecture and contains only weights? Or is it something that I am missing?
Here is the snippet of the code
MicroMutableOpResolver loads the subset of operations needed for your model to be interpreted by MicroInterpreter. Alternatively AllOpsResolver which loads all of the operations available can be used, but it is not recommended due to heavy memory usage.
See also: Instantiate operations resolver

How can I add one new class to MS COCO dataset and do transfer learning to achieve more classes?

I've annotated new image with new class according to the approach is recommended by http://www.immersivelimit.com/tutorials/create-coco-annotations-from-scratch
then I combined new class annotations with coco json annotate files and create TFrecord by running
create_coco_tf_record.py from this repository : https://github.com/tensorflow/models/tree/master/research/object_detection/dataset_tools
then I retrained faster_rcnn_resnet101 which its pretrained model is available in Tensorflow Model Zoo. I did retrain process according to this tutorial: https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10
the problem is that the loss curve didn't converge and also had oscillation!!
how can I do to get better result from retraining models?

Deserializing Tensorflow's protocol buffer MetaGraph file

My question is in relation to protocol buffers. I understand that they serialize structured data. Is there a way to deserialize the data back to the original structured data.
For example, Tensorflow produces a MetaGraph file which stores a TensorFlow GraphDef as well as associated metadata necessary for running computation in a graph.
I have a metagrpah of an GoogleNet inception network and I would like to deserialize it to see the fields described in the link.
https://www.tensorflow.org/api_guides/python/meta_graph
That is a beautiful problem. But log story short as I saw in the code MetaGraph this is possible.
https://www.tensorflow.org/api_guides/python/meta_graph
In order for a Python object to be serialized to and from MetaGraphDef, the Python class must implement to_proto() and from_proto() methods.
This would mean that you need to implement those methods define their properties like proto files and that should work. I never tried it.

How to build tensorflow object detection model for custom classes and also include the 90 classess the SSD Mobilenet model contains

I am building a new tensorflow model based off of SSD V1 coco model in order to perform real time object detection in a video but i m trying to find if there is a way to build a model where I can add a new class to the existing model so that my model has all those 90 classes available in SSD MOBILENET COCO v1 model and also contains the new classes that i want to classify.
For example, I have created training data for two classes: man, woman
Now, I built a new tensorflow model that identifies a man and/or woman in a video. However, my model does not have the other 90 classes present in original SSD Mobilenet model. I am looking for a way to concatenate both models or pass more than one model to my code to detect the objects.
If you have any questions or if I am not clear, please feel free to probe me further.
The only way i find is you need to get dataset of SSD Mobilenet model on which it was trained.
Make sure all the images are present in one directory and annotations in another directory.
We should have a corresponding annotation file for each image file
ex: myimage.jpg and myimage.xml
If all the images of your customed dataset are of same formate with SSD Mobilenet model then annotate it with a tool called LabelImg.
Add that images and annotated files to respective images and annotations directory where we have already saved SSD Mobilenet.
Try regenerate new TFrecord and continue with remaining procedure on it.
You can use transfer learning with Tensorflow API.
Transfer learning allows you to load re-trained network and modify the fully connected layer by introducing your classes.
There is full description for this in the following references:
Codelab
A good explanation here
Tensorflow API here for more details
Also you can use google cloud platform for better and faster results:
I wish this helps you.
I don't think there is a way you can add your classes to the existing 90 classes without using the dataset it is previously trained with. Your only way is to use that dataset plus your own and retrain the model.

can property graph be transformed into a RDF dataset?

We know that neo4j and Titan use property graph as their data model, which is more complicate and flexible than RDF. However, my team is building a graph database named gStore which is based on RDF datasets.
gStore can not support N-Quads or property graph because it can not deal with edges which have properties besides its label.
Below is a RDF dataset:
<John> <height> "170"
<John> <play> <football>
Below is a N-Quads dataset:
<John> <height> "170" "2017-02-01"
<John> <play> <football> "2016-03-04"
You can see that property graph is more general and can represent more relations in real life. However, RDF is more simple and our system is based on it. It is really hard to change the whole system's data model. Is there any way to transform a property graph into a RDF graph? If so, how to do it?
If the data model is well transformed, how can we query it? SPARQL language is used to query the RDF dataset, and neo4j has designed a Cypher language to query their property graph. But when we transform a property graph into a RDF graph, how can we query it?
RDF is a mechanism to serialize graph data. You can store your data in Neo4j as a property graph, query it using cypher, and serialize it automatically as RDF for data exchange and interoperability.
Check out the neosemantics plugin for Neo4j. It does exactly what you describe and more.
In the particular case you mention of properties in relationships, which RDF does not support, neosemantics will use RDF-star to avoid data loss during import/export.