我正在尝试将我的模型转换为 pytorch 模型。我的模型是用python中的XGBoost生成的,保存为Json格式,如下:. . .
X_train, X_test, y_train, y_test = train_test_split(...)
enc = OneHotEncoder(handle_unknown='ignore')
Y_train = enc.fit_transform(y_train.values.reshape(-1,1)).toarray()
Y_test = ...
test = ...
clf = XGBClassifier(learning_rate=0.1,
n_estimators=400,
max_depth=5,
min_child_weight=1,
gamma=0,
subsample=0.8,
colsample_bytree=0.8,
objective='multi:softprob',
nthread=4,
num_class=3,
seed=27,
predictor = 'gpu_predictor',
tree_method='gpu_hist',
gpu_id=0)
clf.fit(X_train,train.ravel(),
verbose=False,
early_stopping_rounds=50,
eval_metric='merror',
eval_set=[(X_test, test.ravel())])
y_predict = clf.predict(X_test)
y_train_predict = clf.predict(X_train)
clf.save_model('model.json')
model = XGBClassifier()
model.load_model('model.json')
在这里我尝试将它 从蜂鸟.ml 导入转换
modelc = convert(model, 'pytorch', extra_config={"n_features":54}) modelc.save('hb_model')
###错误
4 5 ----> 6 modelc = convert(model, 'pytorch', extra_config={"n_features":54}) 7 #modelc.save('hb_model') 中的 ValueError Traceback(最近一次调用最后一次)
. . .
ValueError: 以 10 为底的 int() 的无效文字:'chroma_stft
你知道我可能做错了吗?