I want to train my own Word2Vec model for my text corpus. I can get the code from TensorFlow's tutorial. What I don't know is how to save this model to use for CNN text classification later? Should I use pickle to save it and then read it later?
Asked
Active
Viewed 841 times
2 Answers
0
You can use pickle to save it to disk. Then when you are creating the CNN model, load the saved word embedding table and use it to initialize the TensorFlow variable that holds the word embeddings for your CNN classifier.

Aaron
- 2,354
- 1
- 17
- 25
0
No pickling is not the way of saving the model in case of tensorflow.
Tensorflow provides with tensorflow serving for saving the models as proto bufs(for exporting the model). The way to save model would be to save the tensorflow session as: saver.save(sess, 'my_test_model',global_step=1000)
Heres the link for complete answer: Tensorflow: how to save/restore a model?

Ayush Bihani
- 38
- 3