(PyTorch0.4.0) AttributeError: module 'torch' has no attribute 'flatten'

1.問題:AttributeError: module 'torch' has no attribute 'flatten'

 

2. 解決:

參考:'tensorflow.python.layers.layers' has no attribute 'flatten'

torch沒有flatten這個函數,看來確定無疑是我的PyTorch0.4.0版本太老了。 需要更新PyTorch版本

我估計需要重構裝一個新版本的PyTorch。。。。。。。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章