amineHY / WebApp-Computer-Vision-streamlit

Computer Vision application in the web
https://www.inveesion.com
40 stars 21 forks source link

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

Open Ajinkz opened 4 years ago

Ajinkz commented 4 years ago
@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")
github-actions[bot] commented 4 years ago

Message that will be displayed on users' first issue

amineHY commented 4 years ago

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.

justinvibhu commented 2 years ago

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)