{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/MMdnn/issues/401","repository_url":"https://api.github.com/repos/Microsoft/MMdnn","labels_url":"https://api.github.com/repos/Microsoft/MMdnn/issues/401/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/MMdnn/issues/401/comments","events_url":"https://api.github.com/repos/Microsoft/MMdnn/issues/401/events","html_url":"https://github.com/Microsoft/MMdnn/issues/401","id":357193380,"node_id":"MDU6SXNzdWUzNTcxOTMzODA=","number":401,"title":"'NoneType' object has no attribute 'get_attr' when convert from tf to pytorch ","user":{"login":"CaichaoGitHub","id":12059897,"node_id":"MDQ6VXNlcjEyMDU5ODk3","avatar_url":"https://avatars1.githubusercontent.com/u/12059897?v=4","gravatar_id":"","url":"https://api.github.com/users/CaichaoGitHub","html_url":"https://github.com/CaichaoGitHub","followers_url":"https://api.github.com/users/CaichaoGitHub/followers","following_url":"https://api.github.com/users/CaichaoGitHub/following{/other_user}","gists_url":"https://api.github.com/users/CaichaoGitHub/gists{/gist_id}","starred_url":"https://api.github.com/users/CaichaoGitHub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaichaoGitHub/subscriptions","organizations_url":"https://api.github.com/users/CaichaoGitHub/orgs","repos_url":"https://api.github.com/users/CaichaoGitHub/repos","events_url":"https://api.github.com/users/CaichaoGitHub/events{/privacy}","received_events_url":"https://api.github.com/users/CaichaoGitHub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-05T11:52:59Z","updated_at":"2018-09-06T05:36:04Z","closed_at":null,"author_association":"NONE","body":"Platform ubuntu\r\n\r\nPython version:2.7\r\n\r\nSource framework with version Tensorflow 1.4.1 with GPU\r\n\r\nDestination framework with version Pytorch\r\n\r\nPre-trained model path (webpath or webdisk path):\r\n\r\nRunning scripts:\r\n\r\nmmconvert -sf tensorflow -in /home/uc/project/football2/test_tensorflow_retrain/hand_writing_modeo.ckpt.meta -iw /home/uc/project/football2/test_tensorflow_retrain/hand_writing_modeo.ckpt --inputShape 8,8,1 --inNodeName tf_x  --dstNodeName outputnode -df pytorch  -om /home/uc/project/football2/test_tensorflow_retrain\r\n\r\ncommand line outputs:\r\n\r\nParse file [/home/uc/project/football2/test_tensorflow_retrain/hand_writing_modeo.ckpt.meta] with binary format successfully.\r\nTensorflow model file [/home/uc/project/football2/test_tensorflow_retrain/hand_writing_modeo.ckpt.meta] loaded successfully.\r\nTensorflow checkpoint file [/home/uc/project/football2/test_tensorflow_retrain/hand_writing_modeo.ckpt] loaded successfully. [32] variables loaded.\r\nTensorflow has not supported operator [StopGradient] with name [moments/StopGradient].\r\nTensorflow has not supported operator [SquaredDifference] with name [moments/SquaredDifference].\r\nTensorflow has not supported operator [Rsqrt] with name [batchnorm/Rsqrt].\r\nTensorflow has not supported operator [Softmax] with name [Softmax].\r\nTensorflow has not supported operator [ArgMax] with name [outputnode].\r\nIR network structure is saved as [4b5a35eb3cfa476496fc7d3cc80dfccb.json].\r\nIR network structure is saved as [4b5a35eb3cfa476496fc7d3cc80dfccb.pb].\r\nIR weights are saved as [4b5a35eb3cfa476496fc7d3cc80dfccb.npy].\r\nParse file [4b5a35eb3cfa476496fc7d3cc80dfccb.pb] with binary format successfully.\r\nWarning: Graph Construct a self-loop node moments/SquaredDifference. Ignored.\r\nWarning: Graph Construct a self-loop node batchnorm/add/y. Ignored.\r\nWarning: Graph Construct a self-loop node batchnorm/Rsqrt. Ignored.\r\nWarning: Graph Construct a self-loop node Variable_5. Ignored.\r\nWarning: Graph Construct a self-loop node Variable_4. Ignored.\r\nTraceback (most recent call last):\r\n  File \"/home/uc/project/football2/venv/bin/mmconvert\", line 11, in <module>\r\n    sys.exit(_main())\r\n  File \"/home/uc/project/football2/venv/local/lib/python2.7/site-packages/mmdnn/conversion/_script/convert.py\", line 108, in _main\r\n    ret = IRToCode._convert(code_args)\r\n  File \"/home/uc/project/football2/venv/local/lib/python2.7/site-packages/mmdnn/conversion/_script/IRToCode.py\", line 61, in _convert\r\n    emitter.run(args.dstModelPath, args.dstWeightPath, args.phase)\r\n  File \"/home/uc/project/football2/venv/local/lib/python2.7/site-packages/mmdnn/conversion/pytorch/pytorch_emitter.py\", line 44, in run\r\n    super(PytorchEmitter, self).run(dstNetworkPath, dstWeightPath, phase)\r\n  File \"/home/uc/project/football2/venv/local/lib/python2.7/site-packages/mmdnn/conversion/common/DataStructure/emitter.py\", line 21, in run\r\n    self.save_code(dstNetworkPath, phase)\r\n  File \"/home/uc/project/football2/venv/local/lib/python2.7/site-packages/mmdnn/conversion/common/DataStructure/emitter.py\", line 53, in save_code\r\n    code = self.gen_code(phase)\r\n  File \"/home/uc/project/football2/venv/local/lib/python2.7/site-packages/mmdnn/conversion/pytorch/pytorch_emitter.py\", line 95, in gen_code\r\n    line = func(current_node)\r\n  File \"/home/uc/project/football2/venv/local/lib/python2.7/site-packages/mmdnn/conversion/pytorch/pytorch_emitter.py\", line 526, in emit_ReduceMean\r\n    axes = [self._convert_axis(IR_node, x) for x in IR_node.get_attr('axes')]\r\n  File \"/home/uc/project/football2/venv/local/lib/python2.7/site-packages/mmdnn/conversion/pytorch/pytorch_emitter.py\", line 436, in _convert_axis\r\n    **ndim = len(self.IR_graph.get_parent(IR_node.name, [0]).get_attr('_output_shapes')[0].dim)\r\nAttributeError: 'NoneType' object has no attribute 'get_attr'**\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/MMdnn/issues/comments/418970216","html_url":"https://github.com/Microsoft/MMdnn/issues/401#issuecomment-418970216","issue_url":"https://api.github.com/repos/Microsoft/MMdnn/issues/401","id":418970216,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODk3MDIxNg==","user":{"login":"namizzz","id":11597267,"node_id":"MDQ6VXNlcjExNTk3MjY3","avatar_url":"https://avatars1.githubusercontent.com/u/11597267?v=4","gravatar_id":"","url":"https://api.github.com/users/namizzz","html_url":"https://github.com/namizzz","followers_url":"https://api.github.com/users/namizzz/followers","following_url":"https://api.github.com/users/namizzz/following{/other_user}","gists_url":"https://api.github.com/users/namizzz/gists{/gist_id}","starred_url":"https://api.github.com/users/namizzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namizzz/subscriptions","organizations_url":"https://api.github.com/users/namizzz/orgs","repos_url":"https://api.github.com/users/namizzz/repos","events_url":"https://api.github.com/users/namizzz/events{/privacy}","received_events_url":"https://api.github.com/users/namizzz/received_events","type":"User","site_admin":false},"created_at":"2018-09-06T05:36:04Z","updated_at":"2018-09-06T05:36:04Z","author_association":"MEMBER","body":"Hi @CaichaoGitHub , \r\n1. MMdnn focus on the network architecture part , so it doesn't support the operators like StopGradient, SquaredDifference ...\r\n2. please provide your model file for us to debug. It seems a bug about reducemean operator."}}
{"actor":{"display_login":"namizzz"}}