Closed Ariel-JUAN closed 5 years ago
您好 我使用的是python2.7 traceback没有walk_stack的属性。如果我只想使用python2.7,我应该如何修改代码呢?
Any ideas how to solve this problem please?
您好,请问你遇到的这个问题是如何解决的呢 ?@Ariel-JUAN
Hi, I solved this problem by compiling caffe under python3 environment.
Hi, I solved this problem by compiling caffe under python3 environment.
Thanks for your solution. When I use python3, this problem is solved. But I meet a new problem: KeyError: 140477310121448 when I convert run /example/resnet_pytorch_2_caffe.py
Hi,I got this error in pytorch_to_caffe.py", line 530, in call.
def __call__(self,*args,**kwargs): 527 if not NET_INITTED: 528 return self.raw(*args,**kwargs) 529 print(dir(traceback)) 530 for stack in traceback.walk_stack(None): 531 if 'self' in stack[0].f_locals: 532 layer=stack[0].f_locals['self'] 533 if layer in layer_names: 534 log.pytorch_layer_name=layer_names[layer] 535 print(layer_names[layer]) 536 break
And I print the traceback's attribute: ['all', 'builtins', 'doc', 'file', 'name', 'package', '_format_final_exc_line', '_print', '_some_str', 'extract_stack', 'extract_tb', 'format_exc', 'format_exception', 'format_exception_only', 'format_list', 'format_stack', 'format_tb', 'linecache', 'print_exc', 'print_exception', 'print_last', 'print_list', 'print_stack', 'print_tb', 'sys', 'tb_lineno', 'types'] There is no walk_stack. How should I overcome this error?