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

1.问题:AttributeError: module ‘torch’ has no attribute ‘flatten’

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

 

2. 解决:

参考:‘tensorflow.python.layers.layers’ has no attribute ‘flatten’

torch没有flatten这个函数,看来确定无疑是我的PyTorch0.4.0版本太老了。 需要更新PyTorch版本

我估计需要重构装一个新版本的PyTorch。。。。。。。

Related Posts

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注