Solution
Change data type:
data:pd.DataFrame = data.astype('int64')
# 或是:
data:pd.DataFrame = data.astype('float')
Problem resolution
First of all, make sure that the code itself has no problem, because when training the data, when checking the number type of the Dataframe, it is found that the data.dtypes
displayed result is object
, so normal training cannot be performed, just switch the data type.