eToxPred icon indicating copy to clipboard operation
eToxPred copied to clipboard

64 bit sklearn decision tree on 32 bit python

Open Emmanuel-Cruz opened this issue 6 years ago • 7 comments

Hello,

I recently downloaded all dependencies (as you have listed) to all same versions other than openbabel 2.3.2 instead of 2.3.1. When I run the code, I get the following error... Traceback (most recent call last): File "etoxpred.py", line 121, in <module> predicted_values,proba = predict(X,'SA_trained_model_cpu.pkl','Tox_trained_model.pkl') # if cuda is not installed, use the trained_model_cpu File "etoxpred.py", line 113, in predict xtree = joblib.load(tox_model) File "C:\Python27\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 575, in load obj = _unpickle(fobj, filename, mmap_mode) File "C:\Python27\lib\site-packages\sklearn\externals\joblib\numpy_pickle.py", line 507, in _unpickle obj = unpickler.load() File "C:\Python27\lib\pickle.py", line 864, in load dispatch[key](self) File "C:\Python27\lib\pickle.py", line 1139, in load_reduce value = func(*args) File "sklearn\tree\_tree.pyx", line 584, in sklearn.tree._tree.Tree.__cinit__ (sklearn\tree\_tree.c:7533) ValueError: Buffer dtype mismatch, expected 'SIZE_t' but got 'long long'

Which the internet says is from the mismatched bit versions. I could download a 64 bit python, but openbabel only works on 32 bit python. Let me know if you get any issues when trying to run it

Emmanuel-Cruz avatar Jun 05 '19 18:06 Emmanuel-Cruz

I've never had this problem. Openbabel can be very annoying sometimes. Maybe you can try rdkit.

pulimeng avatar Sep 21 '19 05:09 pulimeng

I have the same issue.

bkorumaz avatar Dec 24 '19 20:12 bkorumaz

I got the following errors: /home/pharma1/anaconda3/envs/eTox/lib/python3.7/site-packages/sklearn/externals/joblib/init.py:15: DeprecationWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+. warnings.warn(msg, category=DeprecationWarning) Traceback (most recent call last): File "etoxpred.py", line 121, in predicted_values,proba = predict(X,'SA_trained_model_cpu.pkl','Tox_trained_model.pkl') # if cuda is not installed, use the trained_model_cpu File "etoxpred.py", line 96, in predict regressor = pickle.load(in_strm) UnicodeDecodeError: 'ascii' codec can't decode byte 0xab in position 0: ordinal not in range(128)

xuzhang5788 avatar Jan 29 '20 01:01 xuzhang5788

@xuzhang5788 I think the problem is because the model was trained using lower version of sklearn. You can retrain the model with the dataset we provided, which is described in the readme. The scripts for retraining are also provided.

pulimeng avatar Jan 29 '20 01:01 pulimeng

@bahadirkorumaz Maybe you can try retrain the model using 64-bit python. Both scripts and data are provided.

pulimeng avatar Jan 29 '20 01:01 pulimeng

I've recently updated all the codes to keep up with the latest versions of some of the dependencies. And everything can be installed via Anaconda. The README file is also updated. Can you redownload everything and let me know if they are working properly. Thanks

pulimeng avatar Sep 26 '20 02:09 pulimeng

Dear @Emmanuel-Cruz

The issue is that the machine you used when training the model has version which is different from the one you are using to test the model or where you are deploying it. So, consider retraining on the same machine or update version.

It happened to me when I was trying to deploy my model on Raspberrypi, but when I retrained it on RPi it worked 100%.

ouwayo avatar May 08 '21 11:05 ouwayo