using CoreML converters encounters sklearn version problem

Viewed 89

I have to transfer my trained model to iOS app, so I used coremltools to do it.

the loading model part and converting part are as following.

with open(filepath,'rb') as f:
rfc = joblib.load(f)
coreml_model=coremltools.converters.sklearn.convert(rfc, X_columns, Y_columns)

and I got this error code.

NameError: name '_tree' is not defined

  1. I have checked the type of rfc, and it show "sklearn.ensemble._forest.RandomForestClassifier"

  2. I have tried to lower my sklearn version to 0.19 ( right now is 0.24 ), but my model would face another problems, plus I cannot run the training code.

so, how can I fix this problem without downgrading my sklearn version?

0 Answers
Related