You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error when "json.loads()" with "\" special charset using key
for exam
{ "\" : "aa" }
so should be exist escape code
Reproducible example
it happend used "shap.TreeExplainer", it is anothor open source, but referce it so write issue
Environment info
LightGBM version or commit hash:
using lightgbm-4.3.0.dist-info
Command(s) you used to install LightGBM
Traceback (most recent call last):
File "/home/f1/wmds-deep-scanner/agent.py", line 411, in predict
explain = getXaiDetector(model_name, value)
File "/home/f1/wmds-deep-scanner/agent.py", line 214, in getXaiDetector
explainer = shap.TreeExplainer(MODEL_MAP[model_name])
File "/home/f1/wmds-deep-scanner/virtual/lib/python3.10/site-packages/shap/explainers/_tree.py", line 195, in __init__
self.model = TreeEnsemble(model, self.data, self.data_missing, model_output)
File "/home/f1/wmds-deep-scanner/virtual/lib/python3.10/site-packages/shap/explainers/_tree.py", line 1140, in __init__
tree_info = self.original_model.dump_model()["tree_info"]
File "/home/f1/wmds-deep-scanner/virtual/lib/python3.10/site-packages/lightgbm/basic.py", line 4387, in dump_model
ret = json.loads(string_buffer.value.decode('utf-8'), object_hook=object_hook)
File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 9 column 468 (char 631)
Additional Comments
it is happend under here, into basic.py
origin code
# basic.py, line 4661
ret = json.loads(string_buffer.value.decode("utf-8"), object_hook=object_hook)
ret["pandas_categorical"] = json.loads(
json.dumps(
self.pandas_categorical,
default=_json_default_with_numpy,
)
)
fix code
# basic.py, line 4661
ret = json.loads(string_buffer.value.decode("utf-8").replace("\\", "\\\\"), object_hook=object_hook)
ret["pandas_categorical"] = json.loads(
json.dumps(
self.pandas_categorical,
default=_json_default_with_numpy,
)
)
how about it ?, Can i do pull request ?
The text was updated successfully, but these errors were encountered:
I don't fully understand this report. Can you provide a minimal, reproducible example showing this behavior? For example, modify this code in a way that causes LightGBM to generate this error:
This issue has been automatically closed because it has been awaiting a response for too long. When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened. If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one. Thank you for taking the time to improve LightGBM!
Description
error when "json.loads()" with "\" special charset using key
for exam
{ "\" : "aa" }
so should be exist escape code
Reproducible example
it happend used "shap.TreeExplainer", it is anothor open source, but referce it so write issue
Environment info
LightGBM version or commit hash:
using lightgbm-4.3.0.dist-info
Command(s) you used to install LightGBM
Additional Comments
it is happend under here, into basic.py
origin code
fix code
how about it ?, Can i do pull request ?
The text was updated successfully, but these errors were encountered: