![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytorch
撒哈拉的小屋
喜欢创造,喜欢用欣赏的眼光看世界
展开
-
Anaconda3+windows10+pytorch+cpu安装
1 安装anconda3 这个很简单,直接在官网上下载,直接安装就行。附帖子:https://jingyan.baidu.com/article/eae078275a31851fec5485b8.html 2 查看Anaconda3自带的python 的版本 打开Anaconda prompt 命令行窗口,输入python.查看版本,我的是3.7.1 2 安装pytorch 进...原创 2019-04-22 11:20:51 · 1074 阅读 · 0 评论 -
IndexError: invalid index of a 0-dim tensor. Use tensor.item()
用pytorch时会出现这种情况: test_loss += criterion(output, target).data[0] 这条语句会报错: IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number anaconda会提示用ite...原创 2019-04-22 20:13:09 · 1023 阅读 · 0 评论