[Python] TimeoutError occured when using wandb.init

Discussão em 'Python' iniciado por Stack, Julho 27, 2025.

  1. Stack

    Stack Membro Participativo

    I used wandb.init and resulted in the error below.

    wandb: Currently logged in as: MyWandbAccount (accountname) to https://api.wandb.ai. Use `wandb login --relogin` to force relogin
    wandb: ERROR Run initialization has timed out after 90.0 sec. Please try increasing the timeout with the `init_timeout` setting: `wandb.init(settings=wandb.Settings(init_timeout=120))`.
    Traceback (most recent call last):
    File "**\lib\asyncio\locks.py", line 226, in wait
    await fut
    asyncio.exceptions.CancelledError

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "**\lib\asyncio\tasks.py", line 490, in wait_for
    return fut.result()
    asyncio.exceptions.CancelledError

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
    File "**\lib\site-packages\wandb\sdk\mailbox\response_handle.py", line 105, in wait_async
    await asyncio.wait_for(evt.wait(), timeout=timeout)
    File "**\lib\asyncio\tasks.py", line 492, in wait_for
    raise exceptions.TimeoutError() from exc
    asyncio.exceptions.TimeoutError

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
    File "**\lib\site-packages\wandb\sdk\wandb_init.py", line 996, in init
    result = wait_with_progress(
    File "**\lib\site-packages\wandb\sdk\mailbox\wait_with_progress.py", line 24, in wait_with_progress
    return wait_all_with_progress(
    File "**\lib\site-packages\wandb\sdk\mailbox\wait_with_progress.py", line 87, in wait_all_with_progress
    return asyncio_compat.run(progress_loop_with_timeout)
    File "**\lib\site-packages\wandb\sdk\lib\asyncio_compat.py", line 30, in run
    return future.result()
    File "**\lib\concurrent\futures\_base.py", line 446, in result
    return self.__get_result()
    File "**\lib\concurrent\futures\_base.py", line 391, in __get_result
    raise self._exception
    File "**\lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
    File "**\lib\site-packages\wandb\sdk\lib\asyncio_compat.py", line 74, in run
    return asyncio.run(self._run_or_cancel(fn))
    File "**\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
    File "**\lib\asyncio\base_events.py", line 647, in run_until_complete
    return future.result()
    File "**\lib\site-packages\wandb\sdk\lib\asyncio_compat.py", line 98, in _run_or_cancel
    return fn_task.result()
    File "**\lib\site-packages\wandb\sdk\mailbox\wait_with_progress.py", line 82, in progress_loop_with_timeout
    return await _wait_handles_async(
    File "**\lib\site-packages\wandb\sdk\mailbox\wait_with_progress.py", line 132, in _wait_handles_async
    task_group.start_soon(wait_single(index))
    File "**\lib\contextlib.py", line 188, in __aexit__
    await self.gen.__anext__()
    File "**\lib\site-packages\wandb\sdk\lib\asyncio_compat.py", line 190, in open_task_group
    await task_group._wait_all()
    File "**\lib\site-packages\wandb\sdk\lib\asyncio_compat.py", line 159, in _wait_all
    raise exc
    File "**\lib\site-packages\wandb\sdk\mailbox\wait_with_progress.py", line 128, in wait_single
    results[index] = await handle.wait_async(timeout=timeout)
    File "**\lib\site-packages\wandb\sdk\mailbox\mailbox_handle.py", line 122, in wait_async
    response = await self._handle.wait_async(timeout=timeout)
    File "**\lib\site-packages\wandb\sdk\mailbox\response_handle.py", line 114, in wait_async
    raise TimeoutError(
    TimeoutError: Timed out waiting for response on e7xd9o236nud

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "**\lib\site-packages\wandb\sdk\wandb_init.py", line 1620, in init
    wandb._sentry.reraise(e)
    File "**\lib\site-packages\wandb\analytics\sentry.py", line 157, in reraise
    raise exc.with_traceback(sys.exc_info()[2])
    File "**\lib\site-packages\wandb\sdk\wandb_init.py", line 1606, in init
    return wi.init(run_settings, run_config, run_printer)
    File "**\lib\site-packages\wandb\sdk\wandb_init.py", line 1009, in init
    raise CommError(
    wandb.errors.errors.CommError: Run initialization has timed out after 90.0 sec. Please try increasing the timeout with the `init_timeout` setting: `wandb.init(settings=wandb.Settings(init_timeout=120))`.


    I wonder what is the matter with my network. I am from China and I use a ProxyServer to visit websites like Google, Youtube, reddit, etc. I can visit these pages successfully, but ping www.google.com will result in a timeout. Seemingly wandb requires a ProxyServer, I can visit wandb in my browser, but pycharm cannot visit those webpages.

    Continue reading...

Compartilhe esta Página