question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

joblib.load() EOFError? how can i solve it?

See original GitHub issue
Traceback (most recent call last):
  File "main_predict.py", line 30, in <module>
    classifier_dict = joblib.load(config.model_save_path + model_name)
  File "/home/xipuhu/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 598, in load
    obj = _unpickle(fobj, filename, mmap_mode)
  File "/home/xipuhu/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 526, in _unpickle
    obj = unpickler.load()
  File "/home/xipuhu/anaconda3/lib/python3.6/pickle.py", line 1048, in load
    raise EOFError
EOFError

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dataderscommented, Feb 7, 2020

@qinhanmin2014 please re-open! I’m experiencing this same issue. Here’s a question @swaticolab opened about this on StackOverflow

I’m pickling a LightGBM model and get the error when I try to unpickle it. Here’s the packages we’re using:

joblib version: 0.14.1
sklearn version: 0.21.3
numpy version: 1.17.3
lightgbm version: 2.3.0

Here’s the traceback:

Traceback (most recent call last):
  File "batch_scoring.py", line 246, in <module>
    clf = joblib.load(open(model_path, 'rb'))
  File "/azureml-envs/azureml_f5505472ec4bb2f554045e3679868236/lib/python3.6/site-packages/joblib/numpy_pickle.py", line 595, in load
    obj = _unpickle(fobj)
  File "/azureml-envs/azureml_f5505472ec4bb2f554045e3679868236/lib/python3.6/site-packages/joblib/numpy_pickle.py", line 529, in _unpickle
    obj = unpickler.load()
  File "/azureml-envs/azureml_f5505472ec4bb2f554045e3679868236/lib/python3.6/pickle.py", line 1048, in load
    raise EOFError
EOFError

update

– my theory is that it has to do w/ the remote environment’s package versions… but sometimes it it will work even when joblib sklearn numpy and lightgbm` are the same exact version what other packages be at play here?

joblib version: 0.14.1
sklearn version: 0.21.3
numpy version: 1.17.3
lightgbm version: 2.3.0
fetching from previous step output
model_path: /mnt/batch/tasks/shared/LS_root/jobs/avadevitsmlsvc/azureml/3d008ca5-e48a-410f-ab03-0636e87d5aaa/mounts/marketing_pipeline_blob/azureml/15c3c155-30f3-439c-a782-41d4774c963b/best_run_data/data.pkl
yhat_test...... (14875,)
/azureml-envs/azureml_f5505472ec4bb2f554045e3679868236/lib/python3.6/site-packages/shap/explainers/tree.py:194: UserWarning: LightGBM binary classifier with TreeExplainer shap values output has changed to a list of ndarray
  warnings.warn('LightGBM binary classifier with TreeExplainer shap values output has changed to a list of ndarray')

The experiment completed successfully. Finalizing run...
Cleaning up all outstanding Run operations, waiting 300.0 seconds
3 items cleaning up...
Cleanup took 0.2609531879425049 seconds
Starting the daemon thread to refresh tokens in background for process with pid = 153
0reactions
thomasjpfancommented, Jan 26, 2022

This issue is not actionable without a stand-alone snippet to reproduce.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EOFError by using joblib.load - python - Stack Overflow
It looks like the file is corrupted or in a different format than the one expected. Unfortunately, without the file, it is impossible...
Read more >
Reading pickle file using joblib gives error: ValueError - Reddit
I have created a pickle file using joblib.dump(). I earlier used pickle.dump(). but it gave me memory error so i switched to joblib....
Read more >
pandas read_pickle eoferror
joblib load eof error. Joblib provides joblib.register_compressor() in order to extend the list of default compressors available. To fit with Joblib internal ...
Read more >
Handling EOFError Exception in Python - GeeksforGeeks
EOFError is raised when one of the built-in functions input() or raw_input() hits an end-of-file condition (EOF) without reading any data. This ...
Read more >
I'm getting a "EOFError: EOF when reading a line" Error while ...
I'm trying to solve this problem - but getting the above mentioned error at ... q=int(input()) z="" for i in range(1,q+1): A =...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found