Closed arcelien closed 6 years ago
Hi, that's a pretty nice contribution, thank you!
I haven't tested it myself, but it looks like it shouldn't break any of the existing code, so I'm merging and knocking on wood ;-)
@arcelien hi, I use the code of freeze.py, when I run the code, there is error "AssertionError: head/emb is not in graph". Have you met this error? I printed the name of the nodes, the format of the node looked like "u'emb/biases', u'emb/biases/Assign', u'emb/biases/read', u'head/emb/MatMul', u'head/emb/BiasAdd', u'save/Const'". Thanks.
I haven't run this code in a while, but freeze.py only queries head/out_emb, not head/emb. The names were added in the construction of the tf graph, so you could try renaming it if it's not working.
OK. thanks ^^
Hey! I needed to get a frozen version of the pretrained model, so I wrote some code that names the output embedding and freezes the model. Also included a small example of loading the model and a quick speed benchmark.
This seems like pretty generic functionality that others might find useful? Tried to follow the same structure as the original code. Thanks :)