dmitryikh / leaves

pure Go implementation of prediction part for GBRT (Gradient Boosting Regression Trees) models from popular frameworks
MIT License
419 stars 72 forks source link

use XGEnsembleFromFile to load the xgb model, model_t, err := leaves.XGEnsembleFromFile("xgb_model.json", true) #91

Open absent1353 opened 2 months ago

absent1353 commented 2 months ago

panic: runtime error: makeslice: len out of range goroutine 1 [running]: github.com/dmitryikh/leaves/internal/xgbin.ReadString(0x140000940c0) go/pkg/mod/github.com/dmitryikh/leaves@v0.0.0-20230708180554-25d19a787328/internal/xgbin/xgbin_io.go:176 +0x68 github.com/dmitryikh/leaves/internal/xgbin.ReadModelHeader(0x140000940c0) go/pkg/mod/github.com/dmitryikh/leaves@v0.0.0-20230708180554-25d19a787328/internal/xgbin/xgbin_io.go:230 +0x6c github.com/dmitryikh/leaves.XGEnsembleFromReader(0x140000940c0, 0x1) go/pkg/mod/github.com/dmitryikh/leaves@v0.0.0-20230708180554-25d19a787328/xgensemble_io.go:140 +0x40 github.com/dmitryikh/leaves.XGEnsembleFromFile({0x1026945ce?, 0x102605838?}, 0x1) go/pkg/mod/github.com/dmitryikh/leaves@v0.0.0-20230708180554-25d19a787328/xgensemble_io.go:259 +0x138 main.main() Documents/code/GoAI/main.go:98 +0x40 exit status 2

how can I fix the error

abucu commented 1 month ago

try xgb 0.90, and no json... https://github.com/dmitryikh/leaves/issues/80