Code Monkey home page Code Monkey logo

sidekit's People

Contributors

hnourtel avatar pchampio avatar

Stargazers

 avatar

Watchers

 avatar  avatar

sidekit's Issues

Error in xtractor.load_state_dict

Hello!
I tried to reproduce your example code (Downloaded model from https://github.com/deep-privacy/sidekit/releases/download/sidekit_v0.1/best_halp_clr_adam_aam0.2_30_b256_vox12.pt_epoch71)

model_path = './best_halp_clr_adam_aam0.2_30_b256_vox12.pt_epoch71'
device = 'cuda' if torch.cuda.is_available() else 'cpu'

model_config = torch.load(model_path, map_location=device)

model_opts = model_config['model_archi']
if 'embedding_size' not in model_opts:
model_opts['embedding_size'] = 256
xtractor = Xtractor(model_config['speaker_number'],
model_archi=model_opts['model_type'],
loss=model_opts['loss']['type'],
embedding_size=model_opts['embedding_size'])

xtractor.load_state_dict(model_config['model_state_dict'], strict=True)

And I got the following:

RuntimeError Traceback (most recent call last)
in ()
12 embedding_size=model_opts['embedding_size'])
13
---> 14 xtractor.load_state_dict(model_config['model_state_dict'], strict=True)
15 xtractor = xtractor.to(device)
16 xtractor.eval()

/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict)
1481 if len(error_msgs) > 0:
1482 raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
-> 1483 self.class.name, "\n\t".join(error_msgs)))
1484 return _IncompatibleKeys(missing_keys, unexpected_keys)
1485

RuntimeError: Error(s) in loading state_dict for Xtractor:
size mismatch for stat_pooling.attention.0.weight: copying a param with shape torch.Size([128, 7680, 1]) from checkpoint, the shape in current model is torch.Size([128, 61440, 1]).
size mismatch for stat_pooling.attention.4.weight: copying a param with shape torch.Size([2560, 128, 1]) from checkpoint, the shape in current model is torch.Size([20480, 128, 1]).
size mismatch for stat_pooling.attention.4.bias: copying a param with shape torch.Size([2560]) from checkpoint, the shape in current model is torch.Size([20480]).

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.