AttributeError: module ‘torch‘ has no attribute ‘inference_mode‘

在运行论文源码时弹出AttributeError: module 'torch' has no attribute 'inference_mode' 异常

原因是pytorch版本问题

torch.inference_mode()在v1.9发布的,所以要保证pytorch版本在1.9以上。

pytorch 以前版本安装命令网站

https://pytorch.org/get-started/previous-versions/

猜你喜欢

转载自blog.csdn.net/qq_38463737/article/details/123959342
今日推荐