Code Monkey home page Code Monkey logo

Comments (4)

hpc203 avatar hpc203 commented on May 25, 2024

这个错误的原因是,输入数据没有转换到gpu设备上。在mtcnn_detect.detect()函数里对输入做设备转换,Input.to(device)

from 10kinds-light-face-detector-align-recognition.

licc0431 avatar licc0431 commented on May 25, 2024

好的,谢谢大神

from 10kinds-light-face-detector-align-recognition.

licc0431 avatar licc0431 commented on May 25, 2024

cv读入的numpy,先torch_from_numpy(),到Tensor,再Input.to(device)。可是这样变成gpu上tensor,后面算法又调用numpy,我不知道咋改了,本文才学,请大神指教

from 10kinds-light-face-detector-align-recognition.

hpc203 avatar hpc203 commented on May 25, 2024

cv读入的numpy,先torch_from_numpy(),到Tensor,再Input.to(device)。可是这样变成gpu上tensor,后面算法又调用numpy,我不知道咋改了,本文才学,请大神指教

gpu上的tensor转换到numpy的语法是: Input.data.cpu().numpy()
cpu上的tensor转换到numpy的语法是: Input.data.numpy()

from 10kinds-light-face-detector-align-recognition.

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.