krishnaik06 / Dockers

121 stars 289 forks source link

Trying unpickle estimator RandomForest #17

Open puranjay123 opened 2 years ago

puranjay123 commented 2 years ago

When i tried to run the pickle file it is showing this error UserWarning: Trying to unpickle estimator RandomForestClassifier from version 1.0.2 when using version 1.1.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to: https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations warnings.warn( The solution that I found: Apparently pickle will not work with version mismatch either when there are minor changes it will not work because if we add or rename a field in a class then we cannot unpickle the previous version. it will change the structure of the library. according to this: https://github.com/scikit-learn/scikit-learn/issues/16033****

PS: reply to this thread if anyone found a better approach to handle this issue.

Sherin1998 commented 1 year ago

Have you resolved this ? I'm also getting this issue.

puranjay123 commented 1 year ago

There is a pickle version mismatch apparently pickle will not work if there is a different version . Try installing an older version which matches that version of the code. It should work.

norobama1 commented 10 months ago

I am having the same error,but I'm not able to install the older version of Sklearn so is there any other solution

puranjay123 commented 10 months ago

@norobama1 you don't need to install an older version of sklearn , you need to install older/compatible version of pickle