loguru
loguru copied to clipboard
RuntimeWarning: os.fork() was called. os.fork() is incompatible with multithreaded code, and JAX is multithreaded, so this will likely lead to a deadlock. self.pid = os.fork()
Hi I have trained machine learning python code on google colab but I faced this error. Is there any solution for this: os.fork() is incompatible with multithreaded code, and JAX is multithreaded, so this will likely lead to a deadlock. self.pid = os.fork()
Can you please share the code that produces this warning?
Loguru does not call os.fork().
I use this url: https://github.com/Algolzw/image-restoration-sde
hi I use this code: https://github.com/Algolzw/image-restoration-sde
On Tue, Apr 16, 2024 at 9:29 AM Delgan @.***> wrote:
Can you please share the code that produces this warning?
Loguru does not call os.fork().
— Reply to this email directly, view it on GitHub https://github.com/Delgan/loguru/issues/1125#issuecomment-2058288286, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALIF3BCCZTOHLUSXTG3NVR3Y5S43HAVCNFSM6AAAAABGISM4LSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJYGI4DQMRYGY . You are receiving this because you authored the thread.Message ID: @.***>
Sorry but there is not enough information for me to help you. Please, try to provide a minimal reproducible example involving usage of Loguru.
Right now, I don't understand how the problem you're facing is related to Loguru. As I said, your error is complaining about usage of os.fork() within JAX framework, but Loguru does not make any use of forking.
this bug still exists in tf 2.16.1
Ensure that you have the latest version of JAX installed. There may be fixes in more recent versions that address these issues. You can upgrade JAX and its dependencies as follows:
pip install --upgrade jax jaxlib
I have the same warning bruh, I run on VSC using ubuntu server (with 2 GPU). Has anyone ever been in this same situation as me? Pls help me!!!!!!! Thanks a bunch!
@LeeTunMT Would it be possible for you to please provide a minimal reproducible example so that I can investigate the problem?
Hi there, I just came across this issue. The issue you are facing is not related to Loguru at all. The multiprocessing functionality of torch dataloaders (when the num_workers is set to more than 1), torch uses the os.fork in the backend for dataloading. And JAX also uses it by default. So, if you have more than one worker for data preprocessing (which is quite useful when you want to remove the data preprocessing bottleneck), the issue arises. You should set the number of workers to 1 when working with JAX or use another dataloader (maybe use a custom one, I haven't used other alternatives). Hope it helps. Also note that if you are using someone else's code, they probably have this num_workers set to 8 or something, which is a popular option, so you might need to deep dive into the existing source code.