New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when trying to convert RandomForestClassifier to javascript #28
Comments
Hello @aflugge , can you set the compression level to from sklearn.externals import joblib
# ...
joblib.dump(clf, 'estimator.pkl', compress=0) Darius |
Thanks for the reply. Setting compress=0 does not seem to make any difference. However, with "from sklearn.externals import joblib" rather than "import joblib" as I have done before, I get the different error message as below: Traceback (most recent call last): I did however manage to export my RandomForestClassifier from within Python with |
Okay, I'm glad that it's working now 😄, nevertheless, apparently the module hasn't the permission to create a file. Alternatively you can use Darius |
Hi,
I am trying to run the command:
python -m sklearn_porter -i estimator.pkl --js
as instructed on the github readme, with a sklearn random forest classifier that I saved into estimator.pkl as instructed. I am using Python 3.6 from Anaconda on a Ubuntu 16.04 LTS.
But it fails with following error:
Traceback (most recent call last):
File "/home/user/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/user/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/user/anaconda3/lib/python3.6/site-packages/sklearn_porter/main.py", line 153, in
main()
File "/home/user/anaconda3/lib/python3.6/site-packages/sklearn_porter/main.py", line 105, in main
estimator = joblib.load(input_path)
File "/home/user/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 578, in load
obj = _unpickle(fobj, filename, mmap_mode)
File "/home/user/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 508, in _unpickle
obj = unpickler.load()
File "/home/user/anaconda3/lib/python3.6/pickle.py", line 1050, in load
dispatchkey[0]
KeyError: 239
The text was updated successfully, but these errors were encountered: