值可能太大:ValueError:输入包含NaN,无穷大或dtype('float32')的值太大

时间:2019-05-26 00:12:51

标签: python python-3.x scikit-learn

我正在使某些东西能够预测正在使用的加密方式,但是我得到了错误,我怀疑这是因为int太大,有什么办法可以使限制更大吗?

while True:
  x = input("NCL > ")
  command = x.split(" ")

  if (command[0] == "credits"):
      print("")
      print("Made by core for anthrox")
      print("")
  if (command[0] == "predict"):
      text = int.from_bytes(command[1].encode('utf-8'), byteorder='little')
      print("")
      print(f" Prediction: {clf.predict([[text]])[0]}")
      print("")
NCL > predict 8129gt8192g512512

Traceback (most recent call last):
  File "main.py", line 86, in <module>
    print("")
  File "C:\Users\mrmar\AppData\Local\Programs\Python\Python37\lib\site-packages\sklearn\tree\tree.py", line 430, in predict
    X = self._validate_X_predict(X, check_input)
  File "C:\Users\mrmar\AppData\Local\Programs\Python\Python37\lib\site-packages\sklearn\tree\tree.py", line 391, in _validate_X_predict
    X = check_array(X, dtype=DTYPE, accept_sparse="csr")
  File "C:\Users\mrmar\AppData\Local\Programs\Python\Python37\lib\site-packages\sklearn\utils\validation.py", line 542, in check_array
    allow_nan=force_all_finite == 'allow-nan')
  File "C:\Users\mrmar\AppData\Local\Programs\Python\Python37\lib\site-packages\sklearn\utils\validation.py", line 56, in _assert_all_finite
    raise ValueError(msg_err.format(type_err, X.dtype))
ValueError: Input contains NaN, infinity or a value too large for dtype('float32').

是输出及其错误

0 个答案:

没有答案