使用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 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
最新评论
加个QQ好友2062886936,高价回收,想出售随时可以找我吗
不错,想用
能用吗
6啊
该评论为私密评论
域名卖吗?加个QQ864716046好友,长期收域名,想卖随时可以找我
谢谢分享
WireGuard配置文件还有吗