# PRODIDGY\_CONFIG\_OVERRIDES setting dropout batch\_size and eval\_frequency not working

**URL:** <https://support.prodi.gy/t/prodidgy-config-overrides-setting-dropout-batch-size-and-eval-frequency-not-working/5505>\
**Category:** Uncategorized\
**Tags:** solved, usage, training\
**Created:** [April 1, 2022, 2:46pm UTC](https://support.prodi.gy/t/prodidgy-config-overrides-setting-dropout-batch-size-and-eval-frequency-not-working/5505 "2022-04-01T14:46:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwade625](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/mwade625/32/2620_2.png) [@mwade625](https://support.prodi.gy/u/mwade625)\
**Post date:** [April 1, 2022, 2:46pm UTC](https://support.prodi.gy/t/prodidgy-config-overrides-setting-dropout-batch-size-and-eval-frequency-not-working/5505/1 "2022-04-01T14:46:33Z")

</div>

I have setup PRODIGY\_CONFIG\_OVERRIDES as follows:

export PRODIGY\_CONFIG\_OVERRIDES='{"batch\_size":32, "dropout":0.3, "eval\_frequency":100}'

When I run the training using prodigy and the logging set to VERBOSE,

10:39:23: INIT: Setting all logging levels to 10  
10:39:23: RECIPE: Calling recipe 'train'  
ℹ Using GPU: 0

========================= Generating Prodigy config =========================  
ℹ Auto-generating config with spaCy  
10:39:24: CONFIG: Using config from global prodigy.json  
/home/xxxxxxxx/.prodigy/prodigy.json

10:39:24: CONFIG: Merging config from CLI overrides  
{'batch\_size': 32, 'dropout': 0.30000000000000004, 'eval\_frequency': 100}

However, the program then proceeds as if none of the settings are changed. The generated config.cfg file for the model also does not show the batch\_size, dropout and eval\_frequency settings that I have set in the overrides.

Is there anyway to actually CONFIRM that it using these settings? Also, I have tried adding the section names as a prefix to the settings and no change: (e.g. "training.eval\_frequency": 100)

Thanks,

Michael Wade

P.S. I am only setting the eval\_frequency so I can see if it is picking up my overrides.

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [April 2, 2022, 9:01am UTC](https://support.prodi.gy/t/prodidgy-config-overrides-setting-dropout-batch-size-and-eval-frequency-not-working/5505/2 "2022-04-02T09:01:21Z")

</div>

Hi! The problem here is that the `PRODIGY_CONFIG_OVERRIDES` setting is intended to overwrite the **Prodigy configuration** , i.e. everything that's typically in your `prodigy.json`: [https://prodi.gy/docs/install#config](https://prodi.gy/docs/install#config)

In your case, it sounds like you want to overwrite spaCy training config parameters. You can do this just like you would in `spacy train`, .i.e. by providing them as CLI overrides: [https://prodi.gy/docs/install#config](https://prodi.gy/docs/install#config) For example:

```bash
prodigy train --ner foo,bar --training.batch_size 32

```

---

<div class="post-metadata">

**Author:** ![mwade-noetic](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/mwade-noetic/32/2327_2.png) [@mwade-noetic](https://support.prodi.gy/u/mwade-noetic)\
**Post date:** [April 7, 2022, 3:33pm UTC](https://support.prodi.gy/t/prodidgy-config-overrides-setting-dropout-batch-size-and-eval-frequency-not-working/5505/3 "2022-04-07T15:33:45Z")

</div>

I went ahead and tried it using using the following command line:

prodigy train --label-stats --ner drd\_interrog\_ner\_gold,drd\_interrog\_ner\_silver ./prod\_models\_silver10\_trf --gpu-id 0 --verbose --base-model en\_core\_web\_trf --training.batch\_size 32

I then get the following error:

=========================== Initializing pipeline ===========================  
✘ Config validation error  
training -\> batch\_size extra fields not permitted

{'train\_corpus': 'corpora.train', 'dev\_corpus': 'corpora.dev', 'seed': 0, 'gpu\_allocator': None, 'dropout': 0.1, 'accumulate\_gradient': 3, 'patience': 5000, 'max\_epochs': 0, 'max\_steps': 20000, 'eval\_frequency': 1000, 'frozen\_components': ['tagger', 'parser', 'attribute\_ruler', 'lemmatizer'], 'before\_to\_disk': {'@misc': 'prodigy.todisk\_cleanup.v1'}, 'annotating\_components': [], 'logger': {'@loggers': 'prodigy.ConsoleLogger.v1'}, 'batch\_size': 32, 'batcher': {'@batchers': 'spacy.batch\_by\_padded.v1', 'discard\_oversize': True, 'get\_length': None, 'size': 2000, 'buffer': 256}, 'optimizer': {'@optimizers': 'Adam.v1', 'beta1': 0.9, 'beta2': 0.999, 'L2\_is\_weight\_decay': True, 'L2': 0.01, 'grad\_clip': 1.0, 'use\_averages': True, 'eps': 1e-08, 'learn\_rate': {'@schedules': 'warmup\_linear.v1', 'warmup\_steps': 250, 'total\_steps': 20000, 'initial\_rate': 5e-05}}, 'score\_weights': {'tag\_acc': None, 'dep\_uas': None, 'dep\_las': None, 'dep\_las\_per\_type': None, 'sents\_p': None, 'sents\_r': None, 'sents\_f': None, 'lemma\_acc': None, 'ents\_f': 0.16, 'ents\_p': 0.0, 'ents\_r': 0.0, 'ents\_per\_type': None, 'speed': 0.0}}

If I don't use the --training.batch\_size it goes ahead and runs.

---

<div class="post-metadata">

**Author:** ![mwade-noetic](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/mwade-noetic/32/2327_2.png) [@mwade-noetic](https://support.prodi.gy/u/mwade-noetic)\
**Post date:** [April 8, 2022, 11:56am UTC](https://support.prodi.gy/t/prodidgy-config-overrides-setting-dropout-batch-size-and-eval-frequency-not-working/5505/4 "2022-04-08T11:56:28Z")

</div>

Just as a test, I ran your command line exactly as input and I got the same error message about "extra fields not permitted". Just for clarity I am using version 1.11.7 of Prodigy on Ubuntu 21.10 and python 3.9.7 and spacy is 3.2.3.

> [@ines](#):
>
> `prodigy train --ner foo,bar --training.batch_size 32`

prod

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [April 10, 2022, 10:17am UTC](https://support.prodi.gy/t/prodidgy-config-overrides-setting-dropout-batch-size-and-eval-frequency-not-working/5505/5 "2022-04-10T10:17:30Z")

</div>

Ah sorry, I had just copied over your overrides without actually checking that they're valid config settings. spaCy's config doesn't actually have a `batch_size` setting in the `[training]` block: [https://spacy.io/api/data-formats#config](https://spacy.io/api/data-formats#config)

So it's expected that spaCy complains here. You can customise the batching for `nlp.pipe` and `nlp.evaluate` via `nlp.batch_size`, and the batching strategy during training via `training.batcher`: [https://spacy.io/api/top-level#batchers](https://spacy.io/api/top-level#batchers)
