module 'torch.nn' has no attribute 'LeakyReLu'
时间: 2023-10-05 11:14:18 浏览: 76
PyTorch里面的torch.nn.Parameter()详解
3星 · 编辑精心推荐
The correct spelling of the PyTorch Leaky ReLU activation function is `torch.nn.LeakyReLU`. Note that the "U" in "ReLU" is capitalized and there is no space between "Leaky" and "ReLU". If you still encounter the error message `module 'torch.nn' has no attribute 'LeakyReLU'`, make sure you have the latest version of PyTorch installed and try importing the module again.
阅读全文