PyTorchTypeError: argument 0 不是Variable
发布时间
阅读量:
阅读量
TypeError: argument 0 is not a Variable

问题定位分析
- 变量与张量:输入数据需被转化为 Variable 类型。
解决方案:
- 升级 PyTorch 版本:在当前的 PyTorch 版本(0.4.0)中,Variables 与 tensors 已经被整合在一起,因此这一问题不应再出现错误。(参考网址:https://ptorch.com/news/37.html))

## 查看 PyTorch 版本
>>> import torch
>>> print(torch.__version__)
0.3.1
## 更新 PyTorch 版本
##
pip install http://download.pytorch.o
全部评论 (0)
还没有任何评论哟~
