lightgbm版本问题

[LightGBM] [Fatal] The number of features in data (110) is not the same as it was in training data (114).
You can set ``predict_disable_shape_check=true`` to discard this error, but please be aware what you are doing.
Traceback (most recent call last):
  File "test.py", line 161, in 
    predictions1 += clf.predict(X_test)
  File "/home/amax/anaconda3/envs/tensorflow_1/lib/python3.6/site-packages/lightgbm/basic.py", line 3540, in predict
    data_has_header, is_reshape)
  File "/home/amax/anaconda3/envs/tensorflow_1/lib/python3.6/site-packages/lightgbm/basic.py", line 848, in predict
    preds, nrow = self.__pred_for_np2d(data, start_iteration, num_iteration, predict_type)
  File "/home/amax/anaconda3/envs/tensorflow_1/lib/python3.6/site-packages/lightgbm/basic.py", line 938, in __pred_for_np2d
    return inner_predict(mat, start_iteration, num_iteration, predict_type)
  File "/home/amax/anaconda3/envs/tensorflow_1/lib/python3.6/site-packages/lightgbm/basic.py", line 920, in inner_predict
    preds.ctypes.data_as(ctypes.POINTER(ctypes.c_double))))
  File "/home/amax/anaconda3/envs/tensorflow_1/lib/python3.6/site-packages/lightgbm/basic.py", line 125, in _safe_call
    raise LightGBMError(_LIB.LGBM_GetLastError().decode('utf-8'))
lightgbm.basic.LightGBMError: The number of features in data (110) is not the same as it was in training data (114).
You can set ``predict_disable_shape_check=true`` to discard this error, but please be aware what you are doing.

当使用lightgbm 3.2.1版本时,就会报这个错误,发现我之前用2.2.3的时候就不会,真神奇。

指定版本安装的问题找了很久,发现自己就是个傻子,

pip install lightgbm==2.2.3这句话就解决了。

你可能感兴趣的:(深度学习,python)