Hi,
I am trying to deploy my app and receive KeyError 118. I used a joblib file to pickle my model and that seems to be the issue, but I’m not sure why.
Hey @akhan390,
Are you deploying your app on Streamlit Sharing (if not where are you deploying it)? Can you put your github link and a screen shot of the error longs your getting when you try and deploy?
Thanks!
Marisa
I have the same issue @Marisa_Smith .
Error is as above KeyError: 118
Traceback:
File "/usr/local/lib/python3.7/site-packages/streamlit/script_runner.py", line 332, in _run_script
exec(code, module.__dict__)
File "/app/ontimeperformance/app.py", line 43, in <module>
model = load_model('Randomforestmodel')
File "/home/appuser/.local/lib/python3.7/site-packages/pycaret/classification.py", line 2149, in load_model
verbose=verbose,
File "/home/appuser/.local/lib/python3.7/site-packages/pycaret/internal/tabular.py", line 8966, in load_model
model_name, platform, authentication, verbose
File "/home/appuser/.local/lib/python3.7/site-packages/pycaret/internal/persistence.py", line 373, in load_model
return joblib.load(model_name)
File "/home/appuser/.local/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 585, in load
obj = _unpickle(fobj, filename, mmap_mode)
File "/home/appuser/.local/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 504, in _unpickle
obj = unpickler.load()
File "/usr/local/lib/python3.7/pickle.py", line 1088, in load
dispatch[key[0]](self)
GitHub link to the app and model (GitHub - wandabwa2004/OntimePerformance: Ontime Trains Performance model)
I’m not sure of what I’m doing wrong. A few things :-
- The model is about 200MB and I uploaded via Git-LFS. I did a Git Pull just to check whether the model format changed but seems be the same.
- A smaller model i.e. 19MB works but it lacks many features compared to the updated model.
Is size the issue? I don’t think I’ve utilized the entire 800MB that’s allowed.
Hey @wandabwa2004,
I think I know what the issue is here, right now Streamlit Sharing doesn’t support the git-lfs.
Check out this forum post for more details:
Cheers,
Marisa
Thank you @Marisa_Smith. I’ll look at other ways of making the model accessible as I await Streamlit updates on this.
Git LFS should have gone out in the Streamlit sharing release this evening, please try it out and let us know if you have any issues.
Best,
Randy