[PyTorch] 透過給予 Loss 權重,試圖解決資料不平衡的情況
在這裡紀錄我自己在調適模型的一些經驗,對於熟練者、高手大神們來說可能微不足道,但是或許可以參考一下。
Read More »[PyTorch] 透過給予 Loss 權重,試圖解決資料不平衡的情況在這裡紀錄我自己在調適模型的一些經驗,對於熟練者、高手大神們來說可能微不足道,但是或許可以參考一下。
Read More »[PyTorch] 透過給予 Loss 權重,試圖解決資料不平衡的情況TypeError: not a sequence
在使用 PyTorch 搭建深度學習的模型時,我想上面的這個報錯是最困擾人的。最大的問題是,這個報錯基本上沒有講出到底是發生什麼樣的錯,端看使用者自己去細看自己的資料格式。
Read More »[已解決][PyTorch] TypeError: not a sequence在 PyTorch 當中,這是非常常見的一個問題。
RuntimeError: bool value of Tensor with more than one value is ambiguous
Read More »[已解決][PyTorch] RuntimeError: bool value of Tensor with more than one value is ambiguous在我使用 PyTorch 訓練模型的時候,經常會發生我使用 GPU_A 去訓練模型、儲存模型,然而在測試模型效果的時候,卻不小心使用到了 GPU_B 來讀取測試資料 (我有多片 GPU 可以使用,還滿奢侈的 XDD),然後再用已經儲存好的模型 (GPU_A 訓練) 來測試 ——
Read More »[PyTorch] 判斷當前資料所使用的 GPU今天我在使用 PyTorch 搭建模型的時候,遇到了像以下這樣的報錯:
ValueError: expected sequence of length 300 at dim 1 (got 3)
Read More »[已解決][PyTorch] ValueError: expected sequence of length 300 at dim 1 (got 3)之前,我曾經寫過一篇文章敘述我如何印出我使用 PyTorch 搭建的模型架構,具體連結可以參考文末。但是開心了沒多久,過了一段時間後,當我又要使用這項工具來繪製另一個全新的模型架構準備報告的同時,我卻得到了以下這樣的報錯:
AttributeError: 'tuple' object has no attribute 'size'
Read More »[已解決][PyTorch] AttributeError: 'tuple' object has no attribute 'size'LSTM (Long Short-Term Memory),中文翻譯做『長短期記憶』,是一種循環神經網路 (RNN)。其論文發表於 1997 年,是在自然語言處理當中非常重要、並且好用的模型層。
Read More »[PyTorch] LSTM 的原理與輸入輸出格式紀錄今天我在使用 Python 進行自然語言處理 (NLP) 的遇到了這個問題:
Read More »[已解決] OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.今天,我在使用 PyTorch 搭建 LSTM 模型的時候發生了以下這樣的報錯:
LSTM RuntimeError: input must have 3 dimensions, got 2
Read More »[已解決][PyTorch] LSTM RuntimeError: input must have 3 dimensions, got 2今天,我在使用 PyTorch 讀取一個已經訓練好的模型進行全新資料的分類時,意外地遇到了以下這個報錯:
RuntimeError: Input and parameter tensors are not at the same device, found input tensor at cuda:1 and parameter tensor at cuda:0
Read More »[已解決] RuntimeError: Input and parameter tensors are not at the same device, found input tensor at cpu and parameter tensor at cuda:0