Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: pvals < 0, pvals > 1 or pvals contains NaNs #54

Open
hc20k opened this issue Apr 15, 2020 · 0 comments
Open

ValueError: pvals < 0, pvals > 1 or pvals contains NaNs #54

hc20k opened this issue Apr 15, 2020 · 0 comments

Comments

@hc20k
Copy link

hc20k commented Apr 15, 2020

When setting up this bot with my discord server, I get this exception randomly whenever someone sends the bot a message:

divide
  p_values = distance_magnitudes / sums
/Users/hwashere/Desktop/PROJECTS/python-copebot/common/ml.py:10: RuntimeWarning: divide by zero encountered in log
  preds = np.log(preds) / temperature
Traceback (most recent call last):
  File "copebot_python_edition.py", line 289, in <module>
    cpe.start(retrain_structure=args.retrain_structure, retrain_markov=args.retrain_markov)
  File "copebot_python_edition.py", line 95, in start
    self._main()
  File "copebot_python_edition.py", line 247, in _main
    reply = connector.generate(message, doc=doc)
  File "/Users/hwashere/Desktop/PROJECTS/python-copebot/connectors/connector_common.py", line 164, in generate
    return self._reply_generator.generate(message, doc)
  File "/Users/hwashere/Desktop/PROJECTS/python-copebot/connectors/bot_instance.py", line 17, in generate
    reply = ConnectorReplyGenerator.generate(self, message, doc, ignore_topics=[BOT_USERNAME.split('#')[0]])
  File "/Users/hwashere/Desktop/PROJECTS/python-copebot/connectors/connector_common.py", line 59, in generate
    sentences = generator.generate(db=self._markov_model)
  File "/Users/hwashere/Desktop/PROJECTS/python-copebot/markov_engine.py", line 364, in generate
    if not self._generate_words(db):
  File "/Users/hwashere/Desktop/PROJECTS/python-copebot/markov_engine.py", line 504, in _generate_words
    handle_projections()
  File "/Users/hwashere/Desktop/PROJECTS/python-copebot/markov_engine.py", line 473, in handle_projections
    word_choice_idx = temp(p_values, temperature=MARKOV_MODEL_TEMPERATURE)
  File "/Users/hwashere/Desktop/PROJECTS/python-copebot/common/ml.py", line 13, in temp
    probas = np.random.multinomial(1, preds, 1)
  File "mtrand.pyx", line 3863, in numpy.random.mtrand.RandomState.multinomial
  File "common.pyx", line 323, in numpy.random.common.check_array_constraint
ValueError: pvals < 0, pvals > 1 or pvals contains NaNs```

Any idea what could be causing this crash?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant