- 博客(2)
- 收藏
- 关注
原创 ValueError: Using a target size (torch.Size([1, 531])) that is different to the input size (torch.Si
ValueError: Using a target size (torch.Size([1, 531])) that is different to the input size (torch.Size([531, 1])) is deprecated. Please ensure they have the same size.问题分析:发现是输出特征数据Y的张量写错了,行列不一致。修改.reshape((1,-1))为.reshape((-1,1)),可以正常训练。问题:训练网络时出现。
2024-08-20 22:08:31 90
原创 遇到NameError: name ‘self‘ is not defined
在写def __init__(self)函数时注意空格,直接按下回车键,不要敲多了空格切记切记!问题:NameError: name 'self' is not defined。解决方法: '''搭建神经网络各层'''上述两行代码前面的空格要一致,就不会报错了。
2024-08-20 20:42:19 92
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人