首页 > 技术文章 > AttributeError: module 'torch.jit' has no attribute 'get_trace_graph

wjjcjj 2020-09-25 15:09 原文

pytorch+python

错误:

 

 纠正:

self.trace, _ = torch.jit.get_trace_graph(self.model, args=(self.x,))

为:

self.trace, _ = torch.jit._get_trace_graph(self.model, args=(self.x,))
问题解决

推荐阅读