Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
fee6f4a2
Unverified
Commit
fee6f4a2
authored
Sep 11, 2020
by
shiyu1994
Committed by
GitHub
Sep 11, 2020
Browse files
avoid segment fault in ResetConfig for GBDT in prediction (fix #3317) (#3373)
parent
f7f4e602
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/boosting/gbdt.cpp
src/boosting/gbdt.cpp
+2
-1
No files found.
src/boosting/gbdt.cpp
View file @
fee6f4a2
...
@@ -20,6 +20,7 @@ namespace LightGBM {
...
@@ -20,6 +20,7 @@ namespace LightGBM {
GBDT
::
GBDT
()
GBDT
::
GBDT
()
:
iter_
(
0
),
:
iter_
(
0
),
train_data_
(
nullptr
),
train_data_
(
nullptr
),
config_
(
nullptr
),
objective_function_
(
nullptr
),
objective_function_
(
nullptr
),
early_stopping_round_
(
0
),
early_stopping_round_
(
0
),
es_first_metric_only_
(
false
),
es_first_metric_only_
(
false
),
...
@@ -718,7 +719,7 @@ void GBDT::ResetConfig(const Config* config) {
...
@@ -718,7 +719,7 @@ void GBDT::ResetConfig(const Config* config) {
if
(
train_data_
!=
nullptr
)
{
if
(
train_data_
!=
nullptr
)
{
ResetBaggingConfig
(
new_config
.
get
(),
false
);
ResetBaggingConfig
(
new_config
.
get
(),
false
);
}
}
if
(
config_
->
forcedsplits_filename
!=
new_config
->
forcedbins_filename
)
{
if
(
config_
.
get
()
!=
nullptr
&&
config_
->
forcedsplits_filename
!=
new_config
->
forcedbins_filename
)
{
// load forced_splits file
// load forced_splits file
if
(
!
new_config
->
forcedsplits_filename
.
empty
())
{
if
(
!
new_config
->
forcedsplits_filename
.
empty
())
{
std
::
ifstream
forced_splits_file
(
std
::
ifstream
forced_splits_file
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment