AttributeError: module 'torch.jit' has no attribute 'get_trace_graph

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,))
问题解决
原文地址:https://www.cnblogs.com/wjjcjj/p/13730281.html