Fix loading old model. (#5724)

* Add test.
This commit is contained in:
Jiaming Yuan
2020-05-31 14:55:32 +08:00
committed by GitHub
parent 057c762ecd
commit 9e1b29944e
3 changed files with 20 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ import generate_models as gm
import json
import zipfile
import pytest
import copy
def run_model_param_check(config):
@@ -124,6 +125,9 @@ def test_model_compatibility():
if name.startswith('xgboost-'):
booster = xgboost.Booster(model_file=path)
run_booster_check(booster, name)
# Do full serialization.
booster = copy.copy(booster)
run_booster_check(booster, name)
elif name.startswith('xgboost_scikit'):
run_scikit_model_check(name, path)
else: