{"action":"created","issue":{"url":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues/277","repository_url":"https://api.github.com/repos/ppwwyyxx/tensorpack","labels_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues/277/labels{/name}","comments_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues/277/comments","events_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues/277/events","html_url":"https://github.com/ppwwyyxx/tensorpack/issues/277","id":230383291,"number":277,"title":"ValueError(Variable conv0/W already exists) When Running cifar10-resnet.py","user":{"login":"chengdazhi","id":10631563,"avatar_url":"https://avatars2.githubusercontent.com/u/10631563?v=3","gravatar_id":"","url":"https://api.github.com/users/chengdazhi","html_url":"https://github.com/chengdazhi","followers_url":"https://api.github.com/users/chengdazhi/followers","following_url":"https://api.github.com/users/chengdazhi/following{/other_user}","gists_url":"https://api.github.com/users/chengdazhi/gists{/gist_id}","starred_url":"https://api.github.com/users/chengdazhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chengdazhi/subscriptions","organizations_url":"https://api.github.com/users/chengdazhi/orgs","repos_url":"https://api.github.com/users/chengdazhi/repos","events_url":"https://api.github.com/users/chengdazhi/events{/privacy}","received_events_url":"https://api.github.com/users/chengdazhi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-22T12:42:14Z","updated_at":"2017-05-23T05:33:55Z","closed_at":null,"body":"When I am running cifar10-resnet.py with no additional arguments, I get this ValueError: Variable conv0/W already exists, disallowed. I haven't made any modifications to the code.\r\n\r\nThe weights of the conv layer are not given explicitly, so I think it's a bug in tensorpack.\r\n\r\nThe exhaustive log information: (I have high-lighted logs that I find useful)\r\n\r\nTraceback (most recent call last):\r\n  File \"cifar10-resnet.py\", line 180, in <module>\r\n    SyncMultiGPUTrainer(config).train()\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorpack/train/base.py\", line 93, in train\r\n    self.setup()\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorpack/train/base.py\", line 118, in setup\r\n    self._callbacks.setup_graph(weakref.proxy(self))\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorpack/callbacks/base.py\", line 44, in setup_graph\r\n    self._setup_graph()\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorpack/callbacks/group.py\", line 77, in _setup_graph\r\n    cb.setup_graph(self.trainer)\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorpack/callbacks/base.py\", line 44, in setup_graph\r\n    self._setup_graph()\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorpack/callbacks/inference_runner.py\", line 115, in _setup_graph\r\n    PredictorTowerBuilder(fn, self._prefix).build(self._predict_tower_id)\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorpack/predict/base.py\", line 193, in build\r\n    self._fn(tower)\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorpack/callbacks/inference_runner.py\", line 114, in fn\r\n    self.trainer.model.build_graph(in_tensors)\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorpack/models/model_desc.py\", line 105, in build_graph\r\n    self._build_graph(model_inputs)\r\n  **File \"cifar10-resnet.py\", line 78, in _build_graph\r\n    l = Conv2D('conv0', image, 16, nl=BNReLU)**\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorpack/models/common.py\", line 131, in wrapped_func\r\n    outputs = func(*args, **actual_args)\r\n  **File \"/usr/local/lib/python3.5/dist-packages/tensorpack/models/conv2d.py\", line 60, in Conv2D**\r\n    **W = tf.get_variable('W', filter_shape, initializer=W_init)**\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/variable_scope.py\", line 988, in get_variable\r\n    custom_getter=custom_getter)\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/variable_scope.py\", line 890, in get_variable\r\n    custom_getter=custom_getter)\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/variable_scope.py\", line 348, in get_variable\r\n    validate_shape=validate_shape)\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/variable_scope.py\", line 333, in _true_getter\r\n    caching_device=caching_device, validate_shape=validate_shape)\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/variable_scope.py\", line 639, in _get_single_variable\r\n    name, \"\".join(traceback.format_list(tb))))\r\n**ValueError: Variable conv0/W already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:**\r\n\r\n  **File \"/usr/local/lib/python3.5/dist-packages/tensorpack/models/conv2d.py\", line 60, in Conv2D\r\n    W = tf.get_variable('W', filter_shape, initializer=W_init)\r\n  File \"/usr/local/lib/python3.5/dist-packages/tensorpack/models/common.py\", line 131, in wrapped_func**\r\n    outputs = func(\\*args, \\*\\*actual_args)\r\n  **File \"cifar10-resnet.py\", line 78, in _build_graph\r\n    l = Conv2D('conv0', image, 16, nl=BNReLU)**\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues/comments/303294878","html_url":"https://github.com/ppwwyyxx/tensorpack/issues/277#issuecomment-303294878","issue_url":"https://api.github.com/repos/ppwwyyxx/tensorpack/issues/277","id":303294878,"user":{"login":"ppwwyyxx","id":1381301,"avatar_url":"https://avatars0.githubusercontent.com/u/1381301?v=3","gravatar_id":"","url":"https://api.github.com/users/ppwwyyxx","html_url":"https://github.com/ppwwyyxx","followers_url":"https://api.github.com/users/ppwwyyxx/followers","following_url":"https://api.github.com/users/ppwwyyxx/following{/other_user}","gists_url":"https://api.github.com/users/ppwwyyxx/gists{/gist_id}","starred_url":"https://api.github.com/users/ppwwyyxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppwwyyxx/subscriptions","organizations_url":"https://api.github.com/users/ppwwyyxx/orgs","repos_url":"https://api.github.com/users/ppwwyyxx/repos","events_url":"https://api.github.com/users/ppwwyyxx/events{/privacy}","received_events_url":"https://api.github.com/users/ppwwyyxx/received_events","type":"User","site_admin":false},"created_at":"2017-05-23T05:33:55Z","updated_at":"2017-05-23T05:33:55Z","body":"I can reproduce the bug with 1.0.1. So probably a bug in TF."}}
{"actor":{"display_login":"ppwwyyxx"}}