# InitStartError: Error communicating with wandb process

**URL:** https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015
**Category:** W&B Help
**Tags:** wandb
**Created:** [August 27, 2022, 12:03pm UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015 "2022-08-27T12:03:04Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [August 27, 2022, 12:03pm UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/1 "2022-08-27T12:03:04Z")

</div>

My code run well on wandb 0.12.21, but after I upgrade to the latest version, my code gave me this error `InitStartError: Error communicating with wandb process`. I tried the solution in the document but it doesn’t work. Code is as shown below.

```python
def k_fold(config, log_folder=None, log_init_info=None):
    """
    Performs a k-fold cross validation.

    Args:
        config (Config): Parameters.
        log_folder (None or str, optional): Folder to logs results to. Defaults to None.
        log_init_info (None or dict, optional): Dictionary to init wandb logging.
    """
    scores = []
    nb_folds = 5

    # Data preparation
    print("Creating in-memory dataset ...")

    start_time = time.time()

    in_mem_dataset = InMemoryTrainDataset(
        train_tile_size=config.tile_size,
        reduce_factor=config.reduce_factor,
        train_transfo=HE_preprocess(size=config.tile_size),
        valid_transfo=HE_preprocess(augment=False, size=config.tile_size),
        train_path=config.train_path,
        iter_per_epoch=config.iter_per_epoch,
        on_spot_sampling=config.on_spot_sampling,
        pl_path=config.pl_path,
        use_pl=config.use_pl,
        test_path=config.test_path,
    )
    print(f"Done in {time.time() - start_time :.0f} seconds.")

    for i in config.selected_folds:
        print(f"\n------------- Fold {i + 1} / {nb_folds} -------------\n")

        # Init logging
        if not DEBUG:
            print(f" -> Init wandb logging with name {log_init_info['name_head']}_fold{i + 1} ...")
            wandb.init(
                project=PROJECT_NAME,
                name=f"{log_init_info['name_head']}_fold{i + 1}",
                config=log_init_info['config'],
            )

        meter, history, model = train(config, in_mem_dataset, i, log_folder=log_folder)

        print("\n -> Validating \n")

        val_images = in_mem_dataset.valid_set
        scores += validate(model, config, val_images)

        if log_folder is not None:
            history.to_csv(log_folder + f"history_{i}.csv", index=False)

        if log_folder is None or len(config.selected_folds) == 1:
            return meter

        if not DEBUG:
            wandb.finish()

        # Garbage collect
        del meter
        del model
        torch.cuda.empty_cache()
        gc.collect()

    print(f"\n\n -> Dice CV : {np.mean(scores) :.3f} +/- {np.std(scores) :.3f}")

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)
#### Post date: [August 31, 2022, 9:35am UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/2 "2022-08-31T09:35:40Z")

</div>

Hi Tiny, thanks for writing! Could you please confirm me if you are still having the same error? If so, are you using the 0.13.2 wandb version?

Could you specify if you are having this error in Colab?

---

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [August 31, 2022, 9:49am UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/3 "2022-08-31T09:49:16Z")

</div>

Yes, the issue remains. And yes I’m having this trouble when using version 0.13.2. But, not in Colab, instead I encountered this on my local jupyter lab server.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)
#### Post date: [September 1, 2022, 4:33pm UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/4 "2022-09-01T16:33:36Z")

</div>

Hi Tianyi, thanks for clarifying! Could you please send me the piece of code where you are using `wandb.login()`?

---

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [September 2, 2022, 2:33am UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/5 "2022-09-02T02:33:17Z")

</div>

This successful running uses the same code that went wrong but with a lower version of wands as mentioned before. [https://gist.github.com/NPU-Franklin/f17e1c1875a127df3e82313049e12d92](https://gist.github.com/NPU-Franklin/f17e1c1875a127df3e82313049e12d92)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)
#### Post date: [September 2, 2022, 9:14am UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/6 "2022-09-02T09:14:47Z")

</div>

Hi Tianyi, thanks for your answer! Could you please provide the debug logs files, `debug-internal.log` and `debug.log`? You can find them in `wandb/run-id/logs`

---

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [September 2, 2022, 10:53am UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/7 "2022-09-02T10:53:16Z")

</div>

Currently, I’ve downgraded my wandb and deleted all failed runs’ logs. I will reproduce the error tomorrow. Thanks a lot.

---

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [September 2, 2022, 1:41pm UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/8 "2022-09-02T13:41:48Z")

</div>

run-20220902\_211617-2saiqpw0/debug.log: [Ubuntu Pastebin](https://pastebin.ubuntu.com/p/hTYgSXFpY8/)  
run-20220902\_211617-2saiqpw0/debug-internal.log: [Ubuntu Pastebin](https://pastebin.ubuntu.com/p/Z6DSsRsKvj/)

---

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [September 2, 2022, 1:42pm UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/9 "2022-09-02T13:42:29Z")

</div>

run-20220902\_212941-tt7k9b3u/debug.log: [Ubuntu Pastebin](https://pastebin.ubuntu.com/p/NRD7xMbWdP/)  
run-20220902\_212941-tt7k9b3u/debug-internal.log: **haven’t generated**

---

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [September 2, 2022, 1:47pm UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/10 "2022-09-02T13:47:29Z")

</div>

The above are the two runs that triggered the error. The bug occurred in the second run(run-20220902\_212941-tt7k9b3u) which was right after the first run(run-20220902\_211617-2saiqpw0) finished.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)
#### Post date: [September 2, 2022, 4:47pm UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/11 "2022-09-02T16:47:44Z")

</div>

Hi Tianyi! Thanks for the files! In the second run the `debug-internal.log` hasn’t been generated, could you try sending it again please? Also, could you send me your python file and so I will try to reproduce this error on my end?

---

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [September 3, 2022, 1:57am UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/12 "2022-09-03T01:57:56Z")

</div>

Thanks for the quick reply. The second run’s `debug-internal.log` file literally hasn’t been generated, wandb corrupted before it can generate this file. Sorry for the misleading words. And you can find my python file at [google drive](https://drive.google.com/file/d/15sGc2Jg1pEu7Lilrq8J1L0w4Qa54ldN2/view?usp=sharing). The main training notebook is at CSMMI/notebooks/Training.ipynb.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)
#### Post date: [September 6, 2022, 3:52pm UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/13 "2022-09-06T15:52:18Z")

</div>

Hi Tianyi, thanks for the information and for your patience! I need to ask some internal questions and will get back to you then

---

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [September 7, 2022, 2:18pm UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/14 "2022-09-07T14:18:53Z")

</div>

Thank you for all the help, no need to hurry.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)
#### Post date: [September 7, 2022, 4:01pm UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/15 "2022-09-07T16:01:37Z")

</div>

Hi Tianyi, thanks for your patience!! I’ve been revising your code and have some questions:

- Are you using wandb Local?
- I assume that the solution in the documentation you are using is this: `wandb.init(settings=wandb.Settings(start_method="fork"))`. If so, have you tried both methods, fork and thread? Are they raising the same error message?
- You mentioned that you have downgraded wandb, was the error still occurring after this downgrade?
- I see that, in your notebook, you first run in a cell `wandb.login()`, which seems to be working fine and then in a following cell you call your `k_fold` function, where `wandb.init()` is used. Is the error raising in this cell? Could you send me a screenshot of this error? What happens if you don’t run the `wandb.login()` cell?

---

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [September 8, 2022, 4:06am UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/16 "2022-09-08T04:06:28Z")

</div>

Thank you for your reply. For all the questions:

- No, I am using the online mode. But I also tried to run my code under the offline mode, and the error still existed.
- I tried both solutions and they didn’t work.
- After being downgraded, my code worked fine. No error message.
- Yes, the error occurred in the cell where I called the `k_fold` function. The error message should be stored in the notebook I sent you. And I have already login to wandb through the console, so `wandb.login()` is used for making sure that I am still logging in. If you want me to try to run without the `wandb.login()` cell, please tell me and I will give it a try.

---

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [September 8, 2022, 7:45am UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/17 "2022-09-08T07:45:39Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/e32a03c633cb4e45d0d96a1138224abd18ed5ff0.png)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)
#### Post date: [September 9, 2022, 4:15pm UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/18 "2022-09-09T16:15:06Z")

</div>

Hi Tianyi, thanks for your patience! I’ve escalated this issue to our Engineering Team, thanks for reporting it!  
Even so, there are a few things that could solve it:

```
- Could you try setting `WANDB_DISABLE_SETTING=True`? This would disable ‘service’ which uses tcp sockets instead of grpc. This is usually desirable because grpc is not fork safe and introduces overhead in many same node cases.
- Could you try to reset the environment and run the code again and see if the error is still occurring?
- Could you try with a lower version than 0.13.2 (0.13.1 for example)?

```

Thanks for your help!

---

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [September 10, 2022, 1:27am UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/19 "2022-09-10T01:27:14Z")

</div>

Happy to help! I will try these out and come back to you later.

---

<div class="post-metadata">

### Author: ![franklin2001](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/franklin2001/32/947_2.png) [@franklin2001](https://community.wandb.ai/u/franklin2001)
#### Post date: [September 13, 2022, 7:08am UTC](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015/20 "2022-09-13T07:08:09Z")

</div>

- First, after I set `os.environ["WANDB_DISABLE_SETTING"] = 'True'` (Am I doing this right?), it didn’t work.
- Second, I don’t have enough space to create a new clean environment. Very sorry for that.
- Third, I tried versions `0.13.3`, `0.13.1` and `0.13.0`, and they all failed.

[Next page](https://community.wandb.ai/t/initstarterror-error-communicating-with-wandb-process/3015.md?page=2)
