logo
Loading...

執行google colab出現 錯誤RuntimeError: Legacy autograd function with non-static forward method is deprecated - Cupoy

老師們好, 想請教在Google Colab上執行Day29 demo notebook報錯問題, ...

day29,new-style autograd,google colab

執行google colab出現 錯誤RuntimeError: Legacy autograd function with non-static forward method is deprecated

2020/05/30 04:32 PM
電腦視覺深度學習論壇
Hao Min Lan
觀看數:0
回答數:1
收藏數:0
day29
new-style autograd
google colab

老師們好, 想請教在Google Colab上執行Day29 demo notebook報錯問題, 錯誤訊息: RuntimeError: Legacy autograd function with non-static forward method is deprecated. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function), 上網找了一下是因為Google colab用的Pytorch是1.3以後的版本(確認過PyTorch版本目前是1.5)需要強制轉成新用法, 試著照範例網站上在ssd.py的forward前面加了@staticmethod標籤, 或是把y=net(xx)改成y = SSD.apply(xx)都會報錯: TypeError: apply() missing 1 required positional argument: 'fn', 想請教還有沒有其他解決辦法?謝謝