Potential Github LFS Issue

Hello! I’m pretty new to Streamlit Cloud. I have a pickled object (reorganized_meta.obj) that I’d like to use for my app. Here’s a code snippet of how I’m loading the model:

import streamlit as st 
import pickle 

@st.experimental_memo
def load(file_name):
    with open(file_name, 'rb') as fobj:
        data = fobj.read()
    meta = pickle.loads(data)
    return meta


@st.experimental_memo
def load_objects(): 
    raw_meta = load("./reorganized_meta.obj")
    return raw_meta

Although when deploying, I’m running into the following issue.

2022-02-01 04:08:17.895 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/cache_utils.py", line 126, in get_or_create_cached_value
    return_value = cache.read_value(value_key)
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/memo_decorator.py", line 409, in read_value
    raise e
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/memo_decorator.py", line 402, in read_value
    pickled_value = self._read_from_mem_cache(key)
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/memo_decorator.py", line 445, in _read_from_mem_cache
    raise CacheKeyNotFoundError("Key not found in mem cache")
streamlit.caching.cache_errors.CacheKeyNotFoundError: Key not found in mem cache
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/cache_utils.py", line 126, in get_or_create_cached_value
    return_value = cache.read_value(value_key)
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/memo_decorator.py", line 409, in read_value
    raise e
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/memo_decorator.py", line 402, in read_value
    pickled_value = self._read_from_mem_cache(key)
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/memo_decorator.py", line 445, in _read_from_mem_cache
    raise CacheKeyNotFoundError("Key not found in mem cache")
streamlit.caching.cache_errors.CacheKeyNotFoundError: Key not found in mem cache
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/script_runner.py", line 379, in _run_script
    exec(code, module.__dict__)
  File "/app/geo_private/streamlit_test.py", line 21, in <module>
    reorganize_meta = load_objects()
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/cache_utils.py", line 145, in wrapper
    return get_or_create_cached_value()
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/cache_utils.py", line 137, in get_or_create_cached_value
    return_value = func(*args, **kwargs)
  File "/app/geo_private/streamlit_test.py", line 17, in load_objects
    raw_meta = load("./reorganized_meta.obj")
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/cache_utils.py", line 145, in wrapper
    return get_or_create_cached_value()
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/caching/cache_utils.py", line 137, in get_or_create_cached_value
    return_value = func(*args, **kwargs)
  File "/app/geo_private/streamlit_test.py", line 10, in load
    meta = pickle.loads(data)
ModuleNotFoundError: No module named 'filter'

What does it mean that no module found named “filter”? The pickled obj that I’m trying to load is 171MB so I have it saved to my github repo as a LFS.

Would sincerely appreciate any advice! I don’t recall there being a module named “filter”. Though, I may be incorrect.

Additionally, I tried deploying the app with all available python versions. I’m not using any extra modules aside from pickle.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.