Code Monkey home page Code Monkey logo

Comments (10)

CorentinJ avatar CorentinJ commented on August 26, 2024 1

It looks like the encoder failed to be loaded. What is your version of PyTorch? Have you managed to run other PyTorch models with your setup before?

Also, if you could try to find which of these lines is causing the problem, that would help.

from real-time-voice-cloning.

CorentinJ avatar CorentinJ commented on August 26, 2024 1

The models were trained and executed on pytorch 1.10.

At what point does the code I gave you fail?

from real-time-voice-cloning.

hung96ad avatar hung96ad commented on August 26, 2024

It looks like the encoder failed to be loaded. What is your version of PyTorch? Have you managed to run other PyTorch models with your setup before?

Also, if you could try to find which of these lines is causing the problem, that would help.

Thanks for your answer!
I tried with Pytorch 0.41 and Pytorch 1.1.0.
I change device with CPU on Line 39.
After I change lines, to CPU and can load model encode .
However, it not work.
I debug and discovered line About core dump

from real-time-voice-cloning.

CorentinJ avatar CorentinJ commented on August 26, 2024

Can you put this script at the root of the project and run it, try to see at what point it fails? You will need a torchvision version that matches your pytorch version.

from torchvision.models import resnet18
from encoder import inference as encoder
from pathlib import Path
import numpy as np
import torch


if __name__ == '__main__':
    # Test to see if your pytorch install works on CPU
    print("Forwarding resnet on CPU")
    inputs = np.zeros((4, 3, 224, 224), dtype=np.float32)
    model = resnet18()
    model.forward(torch.from_numpy(inputs))
    
    # Same but on GPU
    print("Forwarding resnet on GPU")
    model = model.cuda()
    model.forward(torch.from_numpy(inputs).cuda())

    # Test to see if the encoder works at all (on CPU) with a small input
    print("Forwarding encoder on CPU")
    weights_fpath = Path("encoder/saved_models/pretrained.pt")
    device = torch.device("cpu")
    encoder.load_model(weights_fpath, device)
    inputs = np.zeros((1, 100, 40), dtype=np.float32)
    encoder.embed_frames_batch(inputs)
    
    # Same but on GPU
    print("Forwarding encoder on GPU")
    device = torch.device("cuda")
    encoder.load_model(weights_fpath, device)
    encoder.embed_frames_batch(inputs)
    

from real-time-voice-cloning.

fazlekarim avatar fazlekarim commented on August 26, 2024

Do you think its because you have PyQt5 and not 4?

from real-time-voice-cloning.

CorentinJ avatar CorentinJ commented on August 26, 2024

Hey @hung96ad, any update?

from real-time-voice-cloning.

hung96ad avatar hung96ad commented on August 26, 2024

Hey @hung96ad, any update?

I tried new code but it not work.
Can you tell me your pytorch version?

from real-time-voice-cloning.

hung96ad avatar hung96ad commented on August 26, 2024

Do you think its because you have PyQt5 and not 4?

I don't think so. Because PyQt5 is frontend, it doesn't affect load models

from real-time-voice-cloning.

hung96ad avatar hung96ad commented on August 26, 2024

The models were trained and executed on pytorch 1.10.

At what point does the code I gave you fail?

Thank you!
I tried install pytorch and torchvision. It's work.
I think you should add requirements torchvision.

from real-time-voice-cloning.

CorentinJ avatar CorentinJ commented on August 26, 2024

I don't think torchvision has any role to play in the repo. It's a source for common datasets and models and I've only used it in the script I gave you. I suspect something else that you did fixed your setup. I'll still keep this issue in mind if someone else has the same problem. Glad this is fixed for you.

from real-time-voice-cloning.

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.