天天看點

AttributeError: module ‘torch.nn‘ has no attribute ‘GELU‘

AttributeError: module ‘torch.nn’ has no attribute 'GELU’

  1. 更新pytorch版本

    去pytorch官網找那行代碼

  2. 源代碼 是 self.af1 = nn.GELU() #original

    變成 self.af1 = nn.ReLU(inplace=True) #me