1)Unable to get repr for <class 'torch.nn.modules.activation.ReLU'>
(大概意思是不能得到对Relu层的描述)
修改之前:
nn.Relu(input)
对于激活层,这有个打代码细节,需要对其实例化。
修改之后:
relu = nn.Relu()
output = relu(input)
2)UserWarning: Implicit dimension choice for softmax has been deprecated.
大概意思是softmax的隐式维度选择已被弃用。
修改之前:
softmax = nn. Softmax()
output = softmax(input)
Softmax()的参数在目前版本python中不手动设置会爆出警告,最好自己设置。
(详细参数作用看pytorch:nn.Softmax()_缦旋律的博客-CSDN博客_nn.softmax pytorch)
修改之后:
softmax = nn. Softmax(dim=0)
output = softmax(input)
3) Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable.
有道翻译:命名张量及其所有相关的api都是实验性的特性,可能会发生变化。请不要将它们用于任何重要的事情,直到它们被释放为稳定。