Skip to content

UnhashableType: Cannot hash object of type _io.BytesIO #1

Description

@Ajinkz
@st.cache(hash_funcs={_io.BytesIO: my_hash_func})
def my_func(...):

Traceback:
  File "C:\Users\Infogen\Desktop\Learn\streamlit\WebApp-Computer-Vision-streamlit\main.py", line 53, in <module>
    main()
  File "C:\Users\Infogen\Desktop\Learn\streamlit\WebApp-Computer-Vision-streamlit\main.py", line 44, in main
    imageWebApp(guiParam)
  File "C:\Users\Infogen\Desktop\Learn\streamlit\WebApp-Computer-Vision-streamlit\main.py", line 23, in imageWebApp
    image = conf.load_image_or_video()
  File "C:\Users\Infogen\Desktop\Learn\streamlit\WebApp-Computer-Vision-streamlit\libraries\utils.py", line 415, in load_image_or_video
    self.data = self.load_image_source()
  File "C:\Users\Infogen\Desktop\Learn\streamlit\WebApp-Computer-Vision-streamlit\libraries\utils.py", line 369, in load_image_source
    self.image = load_image_from_upload(file_path)
  File "d:\programdata\anaconda3\envs\stream\lib\copyreg.py", line 66, in _reduce_ex
    raise TypeError(f"cannot pickle {cls.__name__!r} object")

Activity

  1. github-actions commented on Jun 10, 2020

    @github-actions

    Message that will be displayed on users' first issue

  2. amineHY commented on Jun 10, 2020

    @amineHY
    Owner

    Hi @Ajinkz

    I really suggest creating an issue on here: https://github.com/streamlit/streamlit since it is a problem with streamlit framework.

    You can also post a message in the streamlit community, they are very active: https://discuss.streamlit.io/

    Amine.

  3. justinvibhu commented on Nov 12, 2021

    @justinvibhu

    Can you plz suggest how i solve this problem ?

    UnboundLocalError: local variable 'net' referenced before assignment
    Traceback:
    File "C:\python\lib\site-packages\streamlit\script_runner.py", line 354, in _run_script
    exec(code, module.dict)
    File "C:\Users\Admin\Downloads\Compressed\Project\WebApp-Computer-Vision-streamlit-master\main.py", line 53, in
    main()
    File "C:\Users\Admin\Downloads\Compressed\Project\WebApp-Computer-Vision-streamlit-master\main.py", line 44, in main
    imageWebApp(guiParam)
    File "C:\Users\Admin\Downloads\Compressed\Project\WebApp-Computer-Vision-streamlit-master\main.py", line 29, in imageWebApp
    bboxed_frame, output = AppManager(guiParam).process(image, True)
    File "C:\Users\Admin\Downloads\Compressed\Project\WebApp-Computer-Vision-streamlit-master\libraries\utils.py", line 199, in init
    self.objApp = self.setupApp()
    File "C:\Users\Admin\Downloads\Compressed\Project\WebApp-Computer-Vision-streamlit-master\libraries\utils.py", line 281, in setupApp
    self.objApp = plugins.Object_Detection_YOLO(self.paramYoloTinyFire)
    File "C:\Users\Admin\Downloads\Compressed\Project\WebApp-Computer-Vision-streamlit-master\libraries\plugins.py", line 93, in init
    self.net = self.load_YOLO_model(
    File "C:\python\lib\site-packages\streamlit\legacy_caching\caching.py", line 574, in wrapped_func
    return get_or_create_cached_value()
    File "C:\python\lib\site-packages\streamlit\legacy_caching\caching.py", line 558, in get_or_create_cached_value
    return_value = func(*args, **kwargs)
    File "C:\Users\Admin\Downloads\Compressed\Project\WebApp-Computer-Vision-streamlit-master\libraries\plugins.py", line 122, in load_YOLO_model
    net.setPreferableBackend(cv.dnn.DNN_BACKEND_OPENCV)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions