
Debug
呀比小饼干
这个作者很懒,什么都没留下…
展开
-
报错:RuntimeError: view size is not compatible with input tensor‘s size and stride
报错:RuntimeError: view size is not compatible with input tensor‘s size and stridedef attention_net(self, lstm_output, final_state): batch_size = lstm_output.size(0) hidden = final_state.view(batch_size, -1, 1) attn_weights原创 2022-03-24 17:48:23 · 864 阅读 · 0 评论 -
报错:UserWarning: Using a target size (torch.Size([15])) that is different to the input size
报错:UserWarning: Using a target size (torch.Size([15])) that is different to the input size (torch.Size([15, 1])).问题:训练模型时遇到以下报错解决方法:在forward(self, x)函数体中,在return x之前,加一句x = x.squeeze(-1)以达到降低一维的目的;def forward(self, x): H,(h,c) = self.lstm(x.原创 2022-03-21 00:57:37 · 14558 阅读 · 0 评论 -
报错ValueError: too many values to unpack (expected 2)
报错ValueError: too many values to unpack (expected 2)报错原因:定义的fit()函数的返回值有5个,而训练模型时只接收了两个函数的返回解决方法:将返回值都接收,即可成功运行;原创 2022-03-20 14:01:59 · 7772 阅读 · 0 评论 -
ValueError: There are no more samples after a first-order seasonal differencing.
ValueError: There are no more samples after a first-order seasonal differencing. See http://alkaline-ml.com/pmdarima/seasonal-differencing-issues.html for a more in-depth explanation and potential work-arounds.构建ARIMA模型时遇到以上报错Traceback (most recent call原创 2022-03-18 10:52:09 · 604 阅读 · 0 评论