Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import name 'ForkProcess' from 'multiprocessing.context' #60

Open
yhqqxq opened this issue Apr 10, 2024 · 8 comments
Open

cannot import name 'ForkProcess' from 'multiprocessing.context' #60

yhqqxq opened this issue Apr 10, 2024 · 8 comments

Comments

@yhqqxq
Copy link

yhqqxq commented Apr 10, 2024

The latest main branch will report this error when starting. How to solve it?

Traceback (most recent call last):
File "G:\AI\ZHB\MuseV\scripts\gradio\app.py", line 7, in
import spaces
File "G:\AI\ZHB\MuseV\env\lib\site-packages\spaces_init_.py", line 10, in
from .zero.decorator import GPU
File "G:\AI\ZHB\MuseV\env\lib\site-packages\spaces\zero\decorator.py", line 21, in
from .wrappers import regular_function_wrapper
File "G:\AI\ZHB\MuseV\env\lib\site-packages\spaces\zero\wrappers.py", line 14, in
from multiprocessing.context import ForkProcess
ImportError: cannot import name 'ForkProcess' from 'multiprocessing.context' (G:\AI\ZHB\MuseV\env\lib\multiprocessing\context.py)

@itechmusic
Copy link
Contributor

@yhqqxq this needs gradio=4.12, which is updated in latest docker image.

@itechmusic
Copy link
Contributor

The latest main branch will report this error when starting. How to solve it?

Traceback (most recent call last):
File "G:\AI\ZHB\MuseV\scripts\gradio\app.py", line 7, in
import spaces
File "G:\AI\ZHB\MuseV\env\lib\site-packages\spaces_init_.py", line 10, in
from .zero.decorator import GPU
File "G:\AI\ZHB\MuseV\env\lib\site-packages\spaces\zero\decorator.py", line 21, in
from .wrappers import regular_function_wrapper
File "G:\AI\ZHB\MuseV\env\lib\site-packages\spaces\zero\wrappers.py", line 14, in
from multiprocessing.context import ForkProcess
ImportError: cannot import name 'ForkProcess' from 'multiprocessing.context' (G:\AI\ZHB\MuseV\env\lib\multiprocessing\context.py)

you run in windows system?

@xzqjack
Copy link
Contributor

xzqjack commented Apr 11, 2024

@zhanchao019 it seems @spaces.GPU(duration=180) is not compatible with windows system. We can provide previous version and rename it as app_windows.py

@yhqqxq
Copy link
Author

yhqqxq commented Apr 11, 2024

@itechmusic
Yes, it is on a Windows system. My Gradio is already 4.12, and this error still exists.

@xzqjack
Copy link
Contributor

xzqjack commented Apr 17, 2024

@yhqqxq before we add new app_windows.py, you can annotate @spaces.GPU(duration=180)

@deysurya
Copy link

Hi @xzqjack , thanks much for looking into this. In app.py , I found "@spaces.GPU(duration=180)" in line 39 and line 60. Please let me know if you want to me do the change. Sorry for ignorance, I am new in the world of diffusion.

@Gg811218
Copy link

老版本好像是这个
app.zip

@deysurya
Copy link

hi @Gg811218 , thanks much for the shared code. Is it expected to solve the following issue :

Traceback (most recent call last): File "/workspace/MuseV/scripts/gradio/app.py", line 32, in <module> from gradio_video2video import online_v2v_inference File "/workspace/MuseV/scripts/gradio/gradio_video2video.py", line 506, in <module> vision_clip_extractor = load_vision_clip_encoder_by_name( File "/workspace/MuseV/musev/models/ip_adapter_loader.py", line 59, in load_vision_clip_encoder_by_name vision_clip_extractor = getattr( File "/workspace/MuseV/MMCM/mmcm/vision/feature_extractor/clip_vision_extractor.py", line 54, in __init__ self.image_encoder = CLIPVisionModelWithProjection.from_pretrained( File "/opt/conda/envs/musev/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2053, in to return super().to(*args, **kwargs) File "/opt/conda/envs/musev/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1145, in to return self._apply(convert) File "/opt/conda/envs/musev/lib/python3.10/site-packages/torch/nn/modules/module.py", line 797, in _apply module._apply(fn) File "/opt/conda/envs/musev/lib/python3.10/site-packages/torch/nn/modules/module.py", line 797, in _apply module._apply(fn) File "/opt/conda/envs/musev/lib/python3.10/site-packages/torch/nn/modules/module.py", line 797, in _apply module._apply(fn) File "/opt/conda/envs/musev/lib/python3.10/site-packages/torch/nn/modules/module.py", line 820, in _apply param_applied = fn(param) File "/opt/conda/envs/musev/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1143, in convert return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking) File "/opt/conda/envs/musev/lib/python3.10/site-packages/torch/cuda/__init__.py", line 247, in _lazy_init torch._C._cuda_init() RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx

I am still facing the issue after using the new code at Macbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants