模块对象没有属性

我已经通过源安装了最新版本的pytorch,然后我也得到这个错误。
sameer@sameer-SVF15213SNW:~$ conda update conda
Fetching package metadata .........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at /home/sameer/anaconda2:
#
conda 4.3.22 py27_0
sameer@sameer-SVF15213SNW:~$ conda update pytorch
Fetching package metadata .........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at /home/sameer/anaconda2:
#
pytorch 0.1.12 py27_2cu75 soumith
sameer@sameer-SVF15213SNW:~$ conda update torch

PackageNotInstalledError: Package is not installed in prefix.
prefix: /home/sameer/anaconda2
package name: torch


sameer@sameer-SVF15213SNW:~$ conda update torchvision
Fetching package metadata .........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at /home/sameer/anaconda2:
#
torchvision 0.1.8 py27_2 soumith
sameer@sameer-SVF15213SNW:~$ python testmodel.py


Traceback (most recent call last):
File "testmodel.py", line 16, in <module>
model=torch.load('./firstN.th')
File "/home/sameer/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 229, in load
return _load(f, map_location, pickle_module)
File "/home/sameer/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 377, in _load
result = unpickler.load()
AttributeError: 'module' object has no attribute 'Net'
已邀请:

要回复问题请先登录注册