question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WandB integration: from spacy.cli.train import train doesn't work

See original GitHub issue

There is no train function in spacy.cli.train module.

Hi I am running train-search script as described here for the WandB integration https://github.com/explosion/projects/tree/v3/integrations/wandb

import typer
from pathlib import Path
from spacy.cli.train import train


def main(config_dir: Path, default_config: str, results_dir: Path):
    """Run all config files instead of the default one.
    Ideally, these runs are parellellized instead of run in sequence."""
    for config_file in config_dir.iterdir():
        if config_file.name != default_config:
            output_path = results_dir / config_file.stem
            if not output_path.exists():
                output_path.mkdir()
            train(config_path=config_file, output_path=output_path)


if __name__ == "__main__":
    typer.run(main)

I am getting the following error:

TypeError: train() got an unexpected keyword argument ‘config_path’

I suspect that the error is due to the fact that there is no train function in spacy.cli.train. So I changed this line

from spacy.cli.train import train to

from spacy.cli.train import train_cli and changed the train() to train_cli in the script.

which now gives the following error:

TypeError: train_cli() missing 1 required positional argument: ‘ctx’

Any idea how to make train-search work?

Thank you!

Environment

  • spaCy version: 3.0.0rc2
  • Platform: Darwin-20.1.0-x86_64-i386-64bit
  • Python version: 3.7.9
  • Pipelines: en_core_web_trf (3.0.0a0)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
svlandegcommented, Jan 7, 2021
1reaction
scellatcommented, Jan 7, 2021

Nice!!! Thank you for the update!

Read more comments on GitHub >

github_iconTop Results From Across the Web

spaCy - Documentation - Weights & Biases - Wandb
spaCy config files are used to specify all aspects of training, not just logging -- GPU allocation, optimizer choice, dataset paths, and more....
Read more >
Projects · spaCy Usage Documentation
spaCy projects let you manage and share end-to-end spaCy workflows for different use cases and domains, and orchestrate training, packaging and serving your ......
Read more >
Logging results and uploading models to Weights & Biases
It assumes you're logged in into Wandb via an API key or wandb login . from ray.train.xgboost import XGBoostTrainer def train_model_xgboost ...
Read more >
Introducing spaCy v3.0
You can then run spacy ray train for parallel training. Parallel training with Ray pip install spacy-ray --pre # Check that the CLI...
Read more >
attributeerror: module 'wandb' has no attribute 'run'
I already create new environment ,but it doesn't work. ... from train import parseopt, train from utils.callbacks import Callbacks from utils.general import ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found