训练的时候出现NotImplementedError
来源:6-7 PyTorch搭建cifar10训练脚本-tensorboard记录LOG(上)

桃花坞里小码农
2020-12-28
我自己照着老师的代码写了一遍有这个问题 所以我把loader块的和vgg块的函数直接copy老师仓库里的尝试了一遍还是有这个问题
epoch is: 0
NotImplementedError Traceback (most recent call last)
in ()
20 inputs, labels = inputs.to(device), labels.to(device)
21
—> 22 outputs = net(inputs)
23 loss = loss_func(outputs, labels)
24
1 frames
/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in _forward_unimplemented(self, *input)
173 registered hooks while the latter silently ignores them.
174 “”"
–> 175 raise NotImplementedError
176
177
NotImplementedError:
2回答
-
慕标6171004
2022-02-26
很有可能是在实现网络结构的时候,forward没被正确拼写,或缩进不一致,使得forward没有被重写导致的
00 -
会写代码的好厨师
2021-01-04
1.确定下pytorch版本是否存在问题。2.cuda是否安装正确。3.代码截图可以放一下。
00
相似问题