nadermx / backgroundremover

Background Remover lets you Remove Background from images and video using AI with a simple command line interface that is free and open source.
https://www.backgroundremoverai.com
MIT License
6.46k stars 538 forks source link

Pickle Error #2

Closed pachacamac closed 2 years ago

pachacamac commented 2 years ago

Pickle is not the best choice for storing data like this. The problem is that pickle differs between Python versions. With Python 3.9 I'm getting this for example:

[...]/python3.9/site-packages/torch/serialization.py", line 764, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '<'.

See here and here for more in depths explanations.

I have not tried those myself but it might be worth looking into cPickle or Joblib as an alternative. Not sure if they have the same issues.

nadermx commented 2 years ago

This is actually related to the u2net libraries I'm pulling, I opended an issue to see if I can host them myself, https://github.com/xuebinqin/U-2-Net/issues/236

nadermx commented 2 years ago

@pachacamac I went ahead and refactored and changed the import library process to gdown, https://github.com/nadermx/backgroundremover/commit/540f2af8cf87f92c10e01ed910028d2142e820f3 Upgrade to the newest version and it should be fixed.