使用pytorch的时候,想要对网络进行可视化,结果报错为:
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
这个是使用GPU 的问题,两种修改方法:
1 2 3 |
if __name__ == '__main__': model = fishnet99() torchsummary.summary(model.cuda(), (3, 224, 224)) |
1 2 3 |
if __name__ == '__main__': model = fishnet99() torchsummary.summary(model, (3, 224, 224),device='cpu') |
第一种就是 convert your network to cuda,第二种就是 call torchsummary.summary
with device='cpu'
本文最后更新于2019年12月25日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
看看
有一事请教,我是业余玩家。 sudo vi /etc/sudoers这个命令须在root用户下执行,弹出页面为只读。 所以我执行的是sudo nano /etc/sudoers,弹出的页面就能修改
感谢分享,这个网站真不赖
看看好不好用
这篇文章实在是太赞了,做学术的那种恪尽职守和严肃认真,全篇简明扼要没有一句废话。我引用的博主的链接。 https://www.right.com.cn/forum/forum.php?mod=r
cccc学习学习下
答案
我想卡