[GPU-Zero] _pickle.PicklingError: Can't pickle local object 'State.__init__.<locals>.<lambda>'

#136
by Mar2Ding - opened

Hello,

I'm encountering a compiling error while using the SAM2Long project demo space hosted on Hugging Face: SAM2Long-Demo. I adapt the codebase of SAM2-video-predictor and it seems running smoothly on T4. After uploading a video, I try to click on the image to prompt a point, but an error occurs, and the process fails.

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/spaces/utils.py", line 43, in put
    super().put(obj)
  File "/usr/local/lib/python3.10/multiprocessing/queues.py", line 371, in put
    obj = _ForkingPickler.dumps(obj)
  File "/usr/local/lib/python3.10/multiprocessing/reduction.py", line 51, in dumps
    cls(buf, protocol).dump(obj)
AttributeError: Can't pickle local object 'State.__init__.<locals>.<lambda>'

It appears there is an issue with pickling a local object in the code. Could you help investigate and provide guidance on how to resolve this error?

Thanks for your assistance!

ZeroGPU Explorers org

Hi @Mar2Ding
I guess your issue is the same as the ones resolved with these PRs in other Spaces, so you might want to take a look at them.
https://huggingface.co/spaces/TencentARC/ImageConductor/discussions/2
https://huggingface.co/spaces/wwen1997/Framer/discussions/4

Sign up or log in to comment