Coder Social home page Coder Social logo

测试单张图片时报错: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU. about awesome-backbones HOT 2 CLOSED

whitewatercn avatar whitewatercn commented on June 12, 2024
测试单张图片时报错: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

from awesome-backbones.

Comments (2)

Fafa-DL avatar Fafa-DL commented on June 12, 2024 2

其实是有这个逻辑的,可以看截图代码29-32行,不过现在看来没生效,因为args.device无论在终端是否指定(未指定默认为cuda)都为True,感谢反馈

from awesome-backbones.

whitewatercn avatar whitewatercn commented on June 12, 2024

tools/single_test.py中的

    parser.add_argument(
        '--device', default='cuda', help='Device used for inference')

手动改为

    parser.add_argument(
        # '--device', default='cuda', help='Device used for inference')
        '--device', default='cpu', help='Device used for inference')

即可

期待up加一个自动识别功能,我看不太懂,只能做到这里了

image

from awesome-backbones.

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.