-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,我运行CSTrack的训练代码,为什么会出现错误:TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.恕我愚笨,我感觉您的源代码很好,但是为什么会出现这个错误?望指教 #78
Comments
我也有同样的问题。我先将targets转化为tensor再转换为numpy就可以了。 |
谢谢您,我也解决了,用的别的方法
| |
ljf
|
|
18340354730
***@***.***
|
…---- 回复的原邮件 ----
| 发件人 | ***@***.***> |
| 日期 | 2023年02月15日 21:33 |
| 收件人 | ***@***.***> |
| 抄送至 | ***@***.***>***@***.***> |
| 主题 | Re: [JudasDie/SOTS] 你好,我运行CSTrack的训练代码,为什么会出现错误:TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.恕我愚笨,我感觉您的源代码很好,但是为什么会出现这个错误?望指教 (Issue #78) |
File "/SOTS-MOT/CSTrack/tracking/train_cstrack.py", line 526, in train(hyp, opt, device, tb_writer) File "/SOTS-MOT/CSTrack/tracking/train_cstrack.py", line 380, in train save_dir=log_dir) File "\SOTS-MOT\CSTrack\tracking..\lib\core\mot\eval.py", line 197, in test plot_images(img, output_to_target(output, width, height), paths, str(f), names) # predictions File "\SOTS-MOT\CSTrack\tracking..\lib\core\mot\general.py", line 1142, in output_to_target return np.array(targets) File "\site-packages\torch\tensor.py", line 630, in array return self.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
我也有同样的问题。我先将targets转化为tensor再转换为numpy就可以了。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
请问您复现了论文中的结果了吗 |
只是运行成功了,后面没有在测试集上进行测试
| |
ljf
|
|
18340354730
***@***.***
|
…---- 回复的原邮件 ----
| 发件人 | ***@***.***> |
| 日期 | 2023年04月01日 21:42 |
| 收件人 | ***@***.***> |
| 抄送至 | ***@***.***>***@***.***> |
| 主题 | Re: [JudasDie/SOTS] 你好,我运行CSTrack的训练代码,为什么会出现错误:TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.恕我愚笨,我感觉您的源代码很好,但是为什么会出现这个错误?望指教 (Issue #78) |
谢谢您,我也解决了,用的别的方法 | | ljf | | 18340354730 @.*** |
…
---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2023年02月15日 21:33 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [JudasDie/SOTS] 你好,我运行CSTrack的训练代码,为什么会出现错误:TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.恕我愚笨,我感觉您的源代码很好,但是为什么会出现这个错误?望指教 (Issue #78) | File "/SOTS-MOT/CSTrack/tracking/train_cstrack.py", line 526, in train(hyp, opt, device, tb_writer) File "/SOTS-MOT/CSTrack/tracking/train_cstrack.py", line 380, in train save_dir=log_dir) File "\SOTS-MOT\CSTrack\tracking..\lib\core\mot\eval.py", line 197, in test plot_images(img, output_to_target(output, width, height), paths, str(f), names) # predictions File "\SOTS-MOT\CSTrack\tracking..\lib\core\mot\general.py", line 1142, in output_to_target return np.array(targets) File "\site-packages\torch\tensor.py", line 630, in array return self.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. 我也有同样的问题。我先将targets转化为tensor再转换为numpy就可以了。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
请问您复现了论文中的结果了吗
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
请问您用的什么方法呀?可以详细说说嘛? |
File "/SOTS-MOT/CSTrack/tracking/train_cstrack.py", line 526, in
train(hyp, opt, device, tb_writer)
File "/SOTS-MOT/CSTrack/tracking/train_cstrack.py", line 380, in train
save_dir=log_dir)
File "\SOTS-MOT\CSTrack\tracking..\lib\core\mot\eval.py", line 197, in test
plot_images(img, output_to_target(output, width, height), paths, str(f), names) # predictions
File "\SOTS-MOT\CSTrack\tracking..\lib\core\mot\general.py", line 1142, in output_to_target
return np.array(targets)
File "\site-packages\torch\tensor.py", line 630, in array
return self.numpy()
TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
The text was updated successfully, but these errors were encountered: