Giter Site home page Giter Site logo

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument max in method wrapper_clamp_Tensor) about yoloair HOT 9 CLOSED

iscyy avatar iscyy commented on May 22, 2024
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument max in method wrapper_clamp_Tensor)

from yoloair.

Comments (9)

yang-0201 avatar yang-0201 commented on May 22, 2024

训练命令加了“--device 0”嘛

from yoloair.

kaiwendulantediyiren avatar kaiwendulantediyiren commented on May 22, 2024

训练命令加了“--device 0”嘛

加了,一样报这个错

from yoloair.

kaiwendulantediyiren avatar kaiwendulantediyiren commented on May 22, 2024

训练命令加了“--device 0”嘛
你的能跑起来吗?

from yoloair.

kaiwendulantediyiren avatar kaiwendulantediyiren commented on May 22, 2024

Who can solve this problem?

from yoloair.

yang-0201 avatar yang-0201 commented on May 22, 2024

You can chat with me privately to see what your problem is, Wechat: 1111554

from yoloair.

iscyy avatar iscyy commented on May 22, 2024

You can try
!pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

from yoloair.

kaiwendulantediyiren avatar kaiwendulantediyiren commented on May 22, 2024

It has been resolved. You can replace the torch and cuda versions.
!pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f

from yoloair.

lixiangMindSpore avatar lixiangMindSpore commented on May 22, 2024

It has been resolved. You can replace the torch and cuda versions. !pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f

你下发命令是什么?

from yoloair.

zxp771 avatar zxp771 commented on May 22, 2024

@iscyy
hi,i followed you suggestion,but the error still there.
image

Traceback (most recent call last):
File "D:\yy\yolov7-main\test.py", line 320, in
test(opt.data,
File "D:\yy\yolov7-main\test.py", line 88, in test
model(torch.zeros(1, 3, imgsz, imgsz).to(device).type_as(next(model.parameters()))) # run once
File "D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "D:\yy\yolov7-main\utils\torch_utils.py", line 372, in forward
out = self.model(x)
File "D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
RuntimeError: The following operation failed in the TorchScript interpreter.
Traceback of TorchScript (most recent call last):
D:\yy\yolov7-main\models\common.py(1688): forward
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py(1039): _slow_forward
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py(1051): _call_impl
D:\yy\yolov7-main\models\common.py(1828): forward
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py(1039): _slow_forward
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py(1051): _call_impl
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\container.py(139): forward
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py(1039): _slow_forward
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py(1051): _call_impl
D:\yy\yolov7-main\models\common.py(1867): forward
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py(1039): _slow_forward
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py(1051): _call_impl
D:\yy\yolov7-main\models\common.py(516): forward
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py(1039): _slow_forward
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py(1051): _call_impl
D:\yy\yolov7-main\models\yolo.py(625): forward_once
D:\yy\yolov7-main\models\yolo.py(599): forward
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py(1039): _slow_forward
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\nn\modules\module.py(1051): _call_impl
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\jit_trace.py(952): trace_module
D:\Anaconda\envs\yolo-hornet\lib\site-packages\torch\jit_trace.py(735): trace
D:\yy\yolov7-main\utils\torch_utils.py(362): init
D:\yy\yolov7-main\test.py(63): test
D:\yy\yolov7-main\test.py(320):
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

from yoloair.

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.