当前位置:网站首页>torch‘ has no attribute ‘inference_ mode‘

torch‘ has no attribute ‘inference_ mode‘

2022-07-27 11:47:00 Xiao Chen who wants money

stay overstack flow Someone said it was because of the version problem ,( This order is in torch.1.9 above ), But someone below said that this was not good ;

Solution :

Replace code , take torch.inference_mode() Replace with torch.no_grad()

@torch.no_grad()
# @torch.inference_mode()
    with torch.no_grad():
    # with torch.inference_mode():

原网站

版权声明
本文为[Xiao Chen who wants money]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/208/202207271059007500.html