torch.load()使用中报错layers.py

AttributeError: Can't get attribute 'FlattenedLoss' on <module 'fastai.layers' from 'E:\Program Files\Python39\lib\site-packages\fastai\layers.py'>
改为了全路径还是不行

从网上讨论看,应该是运行的代码与fastai版本不匹配造成的(比如较高版本fastai运行用较低版本编写的代码出现问题),可以查看了下fastai版本,通过升级或降低版本试试。
参考这里: