|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- pre = torch.nn.functional.softmax(torch.tensor(np.array(pre_valid).reshape(-1,2),dtype=torch.float32), dim=-1)
- result = np.argmax(pre,axis=1)
复制代码
代码- ---------------------------------------------------------------------------
- ValueError Traceback (most recent call last)
- Cell In[90], line 1
- ----> 1 pre = torch.nn.functional.softmax(torch.tensor(np.array(pre_valid).reshape(-1),dtype=torch.float32), dim=-1)
- 2 result = np.argmax(pre,axis=1)
- ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (229,) + inhomogeneous part.
复制代码 |
|