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

Process ended with exit code -1073741571 (0xC00000FD) #571

Open
zhangdangdang opened this issue Feb 7, 2023 · 1 comment
Open

Process ended with exit code -1073741571 (0xC00000FD) #571

zhangdangdang opened this issue Feb 7, 2023 · 1 comment

Comments

@zhangdangdang
Copy link

CODE:

from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, recall_score, f1_score, precision_score, classification_report, \
    cohen_kappa_score
import pandas as pd
from sklearn.preprocessing import StandardScaler, MinMaxScaler
import matplotlib.pyplot as plt
from sklearn.feature_selection import VarianceThreshold
import numpy as np
from sklearn.svm import LinearSVC
from sklearn.svm import SVC
def data_set(url):
    input_data_all = pd.read_csv(url, header=None)
    input_data_target = input_data_all.iloc[:, -1]  # [:, -1]
    input_data_feature = input_data_all.iloc[:, [0, 1]].copy()  # [0, 1, 3, 5]

    # 填充
    input_data_feature.replace([np.inf, -np.inf], np.nan, inplace=True)
    input_data_feature.interpolate(method='linear', axis=0, inplace=True)  # 将通过 linear 插值使用同一列的中间值作为填充

    input_data = input_data_feature
    input_data_t = input_data_target
    input_data = input_data.to_numpy()
    input_data = pd.DataFrame(input_data)

    return input_data, input_data_t
def train(train, test):
    x_train, y_train = data_set(train)
    x_train, x_test, y_train, y_test = train_test_split(x_train, y_train, test_size=0.3, random_state=2019)

    scaler = StandardScaler()
    scaler.fit(x_train)
    X_stand = scaler.transform(x_train)
    X_test_stand = scaler.transform(x_test)

    print('训练')
    svm = SVC(C=1.0, verbose=5, kernel='poly', decision_function_shape='ovo').fit(X_stand,
                                                                                   pd.DataFrame(
                                                                                       y_train).values.ravel())
    import sys
    sys.setrecursionlimit(2147483647)
    import m2cgen as m2c
    code = m2c.export_to_c(svm)  # 导出为c代码
    with open(' svm.c', 'w') as f:
        f.write(code)


if __name__ == '__main__':
    test_dataset = '06_PLskip.csv'
    train_dataset = r"t40-202_size-16-RDbest-20fram_1.csv"
    train(test_dataset, test_dataset)

The first error reported was:RecursionError: maximum recursion depth exceeded,
Then follow this link to increase sys.setrecursionlimit(2147483647), the return code has an error
Process ended with exit code -1073741571 (0xC00000FD)

@harshayelchuri
Copy link

Even, I'm facing the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants