udibr / headlines

Automatically generate headlines to short articles
MIT License
526 stars 150 forks source link

RuntimeWarning: invalid value encountered in log #37

Closed deepbodra97 closed 5 years ago

deepbodra97 commented 5 years ago

I am getting this error when I call gensamples() for prediction

RuntimeWarning: invalid value encountered in log cand_scores = np.array(live_scores)[:,None] - np.log(probs)

Also, the output shows HEAD: 3.14... But no words(headlines) are shown along with it

Sometimes the output is nan

prob contains negative values. What could be the possible reason?

When I replace np.log(probs) by np.log(np.absolute(probs)) I get the output sentence with no meaning. The words seem random.

Any help would be greatly appreciated!