Error reporting keyword : Can't get attribute '_unpickle_block' pandas._libs.internals internals.cpython-38-x86_64-linux-gnu.so
Error report detailed log :
File "/home/xxxxx-yyyyy/PycharmProjects/xxxxx/nad_num_predict_service_03.py", line 31, in predict
loaded_model = ARIMAResults.load('model/arima_model.pkl')
File "/home/xxxxx-yyyyy/anaconda3/lib/python3.8/site-packages/statsmodels/base/model.py", line 2239, in load
return load_pickle(fname)
File "/home/xxxxx-yyyyy/anaconda3/lib/python3.8/site-packages/statsmodels/iolib/smpickle.py", line 42, in load_pickle
return pickle.load(fin)
AttributeError: Can't get attribute '_unpickle_block' on <module 'pandas._libs.internals' from '/home/xxxxx-yyyyy/anaconda3/lib/python3.8/site-packages/pandas/_libs/internals.cpython-38-x86_64-linux-gnu.so'>
pickle When serializing and deserializing models , The use of pandas Errors caused by version inconsistencies . keep pandas The version is the same .
Virtual environment is not installed gunicorn, In virtual environment pandas edition =1.4.0,Anaconda Python The environment has gunicorn, And pandas edition =1.1.3.
Use directly in the virtual environment python
The command runs flask web Normal operation of the project , The serialization model is normal (save model
).
When used in virtual environments gunicorn
Run the same flask web Project time , Deserialization model (load model
) Report the above error . Because of this gunicorn yes Anaconda Python Package for environment , Will reference it Anaconda Python In the environment pandas, It is related to pandas Version inconsistency .
https://stackoverflow.com/que...
https://stackoverflow.com/que...
https://stackoverflow.com/que...