成功解决。
新建一个.py文件,然后import torch.nn.modules.activation,按住Ctrl+鼠标左键,进入activation.py文件中,修改393行左右的代码,
原代码:
def forward(self, input: Tensor) -> Tensor:
return F.silu(input, inplace=self.inplace)
修改后的代码
def forward(self, input: Tensor) -> Tensor:
return input * torch.sigmoid(input)