Pytorch Bugs

Pytorch Bugs

本篇用于记录使用Pytorch过程中遇到的bug

AttributeError: module ‘torch.nn._functions’ has no attribute ‘dropout’

1
2
3
4
5
6
Traceback (most recent call last):
File "src/main.py", line 17, in <module>
import parse_nk
File "/home/workspace/self-attentive-parser/src/parse_nk.py", line 74, in <module>
class FeatureDropoutFunction(nn.functional._functions.dropout.InplaceFunction):
AttributeError: module 'torch.nn._functions' has no attribute 'dropout'

将class FeatureDropoutFunction(torch.nn.functional._functions.dropout.InplaceFunction)更改为class FeatureDropoutFunction(torch.autograd.function.InplaceFunction)

-------------本文结束感谢您的阅读-------------
0%