{"action":"opened","issue":{"url":"https://api.github.com/repos/lanpa/tensorboard-pytorch/issues/138","repository_url":"https://api.github.com/repos/lanpa/tensorboard-pytorch","labels_url":"https://api.github.com/repos/lanpa/tensorboard-pytorch/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/lanpa/tensorboard-pytorch/issues/138/comments","events_url":"https://api.github.com/repos/lanpa/tensorboard-pytorch/issues/138/events","html_url":"https://github.com/lanpa/tensorboard-pytorch/issues/138","id":319824222,"number":138,"title":"add_graph raises RuntimeError when parsing constant node","user":{"login":"jhg543","id":11643910,"avatar_url":"https://avatars1.githubusercontent.com/u/11643910?v=4","gravatar_id":"","url":"https://api.github.com/users/jhg543","html_url":"https://github.com/jhg543","followers_url":"https://api.github.com/users/jhg543/followers","following_url":"https://api.github.com/users/jhg543/following{/other_user}","gists_url":"https://api.github.com/users/jhg543/gists{/gist_id}","starred_url":"https://api.github.com/users/jhg543/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhg543/subscriptions","organizations_url":"https://api.github.com/users/jhg543/orgs","repos_url":"https://api.github.com/users/jhg543/repos","events_url":"https://api.github.com/users/jhg543/events{/privacy}","received_events_url":"https://api.github.com/users/jhg543/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-03T08:12:24Z","updated_at":"2018-05-03T08:12:24Z","closed_at":null,"author_association":"NONE","body":"Hello\r\n  I got \"RuntimeError: VariableType::ID() not implemented\" when parsing constant nodes in the computation graph. \r\n\r\ncode to reproduce the RuntimeError:\r\n```python\r\nclass SimpleModel(nn.Module):\r\n    def __init__(self):\r\n        super().__init__()\r\n\r\n    def forward(self, x):\r\n        return x * 2\r\n\r\n\r\ninput = (torch.zeros(1, 2, 3),)\r\n\r\nmodel = SimpleModel()\r\n\r\nwith SummaryWriter(comment='test') as w:\r\n    w.add_graph(model, input)\r\n```\r\n\r\nStack:\r\n\r\n    File \"...tensorboardX\\writer.py\", line 419, in add_graph\r\n        self.file_writer.add_graph(graph(model, input_to_model, verbose))\r\n    File \"...tensorboardX\\graph.py\", line 85, in graph\r\n        list_of_nodes = parse(graph)\r\n    File \"...tensorboardX\\graph.py\", line 28, in parse\r\n        attrs = {k: n[k] for k in n.attributeNames()}\r\n    File \"...tensorboardX\\graph.py\", line 28, in <dictcomp>\r\n        attrs = {k: n[k] for k in n.attributeNames()}\r\n    File \"...torch\\onnx\\utils.py\", line 444, in _node_getitem\r\n        return getattr(self, sel)(k)\r\n    RuntimeError: VariableType::ID() not implemented\r\n    \r\nThe stack shows that calling `Constant[\"value\"]` will give `RuntimeError`\r\nstr(n)  =  \"%1 : Dynamic = onnx::Constant\\[value={2}\\](), scope: SimpleModel\"\r\nn[\"value\"] ==>  RuntimeError\r\n\r\nSo is this a bug or an unimplemented feature of ONNX ?\r\n\r\nMy temporary workaround for this is to set `attrs = str(n)` if `{k: n[k] for k in n.attributeNames()}` raises `RuntimeError`.\r\n\r\npytorch = 0.4.0\r\ntensorflow = 1.8.0\r\ntensorboardX = 1.2\r\n"}}
{"actor":{"display_login":"jhg543"}}