Giter Club home page Giter Club logo

Comments (4)

Chaotic-chaos avatar Chaotic-chaos commented on May 31, 2024

BYW, this code works well without DDP. It seems that there is only one process can load the embedding_model from disk successfully.

from speechbrain.

TParcollet avatar TParcollet commented on May 31, 2024

Hi, this is most likely due to an error in the .py script, can we see the "utils/train_speaker_embeddings_v2_finetune.py"?

from speechbrain.

Chaotic-chaos avatar Chaotic-chaos commented on May 31, 2024

Sorry for the late reply.
There's some code cannot be shown in the .py. But I can show you the main function of it.

    # This flag enables the inbuilt cudnn auto-tuner
    torch.backends.cudnn.benchmark = True

    # CLI:
    hparams_file, run_opts, overrides = sb.parse_arguments(sys.argv[1:])

    # Initialize ddp (useful only for multi-GPU DDP training)
    sb.utils.distributed.ddp_init_group(run_opts)

    # Load hyperparameters file with command-line overrides
    with open(hparams_file) as fin:
        hparams = load_hyperpyyaml(fin, overrides)


    sb.core.create_experiment_directory(
        experiment_directory=hparams["output_folder"],
        hyperparams_to_save=hparams_file,
        overrides=overrides,
    )
    # Initialization of the pre-trainer
    run_on_main(hparams["pretrainer"].collect_files)
    hparams["pretrainer"].load_collected(device=run_opts["device"])
    # run_on_main(hparams["pretrainer"].load_collected(device=run_opts["device"]))

    #print(hparams["pretrainer"].loadables["embedding_model"] is hparams['embedding_model'] )


    # Brain class initialization
    speaker_brain = SpeakerBrain(
        modules=hparams["modules"],
        opt_class=hparams["opt_class"],
        hparams=hparams,
        run_opts=run_opts,
        checkpointer=hparams["checkpointer"],
    )
    #speaker_brain.optimizer.add_param_group({'params':speaker_brain.modules.embedding_model.parameters(),'lr':1e-4})
    #speaker_brain.modules.embedding_model = hparams["pretrainer"].loadables["embedding_model"]

    #print(speaker_brain.modules.embedding_model.state_dict())


    # Training
    speaker_brain.fit(
        speaker_brain.hparams.epoch_counter,
        train_data,
        valid_data,
        train_loader_kwargs=hparams["dataloader_options"],
        valid_loader_kwargs=hparams["dataloader_options"],
    )

from speechbrain.

Adel-Moumen avatar Adel-Moumen commented on May 31, 2024

Hello,

I see that you are using an old version of SpeechBrain. Maybe trying to switch from your old version to SpeechBrain 1.0 (-> git clone speechbrain/speechbrain.git) may solve your issue? In any case, if you requires more in-depth assistance you'll need to provide some scripts to reproduce your issue...

from speechbrain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.