Maluuba / nlg-eval

Evaluation code for various unsupervised automated metrics for Natural Language Generation.
http://arxiv.org/abs/1706.09799
Other
1.35k stars 224 forks source link

Memory is unable to free #89

Closed XiangyanChen closed 5 years ago

XiangyanChen commented 5 years ago

When I call the function 'compute_metrics', I notice that system memory is unable to free. Could u give me some advice on it?

temporaer commented 5 years ago

can you give some more details please? e.g.

XiangyanChen commented 5 years ago

can you give some more details please? e.g.

  • which metrics are you using
  • which platform are you on,
  • how did you try to free memory? (ie which operation failed)

while True: metrics_dict = compute_metrics(hypothesis=hypothesis, references=references, no_skipthoughts=True,no_glove=True)

Everytime I call the function above, I found the memory usage keep increasing and I don't know how to free memory. Therefore I am seeking your help.(My program was running at ubuntu)

juharris commented 5 years ago

I believe I have solved the major reason for this. Sorry we thought we did things to stop this from happening. I'll have a PR coming soon but in the meantime you can use the object oriented version of the API which will also be faster if you're calling it many times because it pre-loads many things: https://github.com/Maluuba/nlg-eval#object-oriented-api-for-repeated-calls-in-a-script---multiple-examples (note that the input is lists, not filenames). You can see what the method you're currently calling does to read the files and just copy that to turn your files into lists.

Just to clarify your two options: 1) Recommended: Use the object oriented API 2) Wait for my pull request