ELMoForManyLangs icon indicating copy to clipboard operation
ELMoForManyLangs copied to clipboard

The size of output model is very large when exporting to ONNX format.

Open hibayesian opened this issue 4 years ago • 0 comments

I am exporting Embedder to ONNX format. But the size of output model is so large(~7G) that I doubt there are many duplications of weights. How to export Embedder correctly?

Code snippet:

model = Embedder(elmo_model_dir).get_model()[0]

torch.onnx.export(model, (w, c, masks), 'output_model.onnx', export_params=True, opset_version=12, do_constant_folding=True, input_names=['w', 'c', 'masks'], output_names=['logits'], use_external_data_format=True)

hibayesian avatar Sep 02 '21 09:09 hibayesian