{"action":"created","issue":{"url":"https://api.github.com/repos/balancap/SSD-Tensorflow/issues/88","repository_url":"https://api.github.com/repos/balancap/SSD-Tensorflow","labels_url":"https://api.github.com/repos/balancap/SSD-Tensorflow/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/balancap/SSD-Tensorflow/issues/88/comments","events_url":"https://api.github.com/repos/balancap/SSD-Tensorflow/issues/88/events","html_url":"https://github.com/balancap/SSD-Tensorflow/issues/88","id":231948027,"number":88,"title":"INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, Assign requires shapes of both tensors to match.","user":{"login":"yongjin120","id":20854361,"avatar_url":"https://avatars2.githubusercontent.com/u/20854361?v=4","gravatar_id":"","url":"https://api.github.com/users/yongjin120","html_url":"https://github.com/yongjin120","followers_url":"https://api.github.com/users/yongjin120/followers","following_url":"https://api.github.com/users/yongjin120/following{/other_user}","gists_url":"https://api.github.com/users/yongjin120/gists{/gist_id}","starred_url":"https://api.github.com/users/yongjin120/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongjin120/subscriptions","organizations_url":"https://api.github.com/users/yongjin120/orgs","repos_url":"https://api.github.com/users/yongjin120/repos","events_url":"https://api.github.com/users/yongjin120/events{/privacy}","received_events_url":"https://api.github.com/users/yongjin120/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-05-29T07:36:33Z","updated_at":"2018-04-15T04:42:57Z","closed_at":null,"author_association":"NONE","body":"INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, Assign requires shapes of both tensors to match. lhs shape= [3,3,256,24] rhs shape= [3,3,256,84]\r\n\t [[Node: save_1/Assign_13 = Assign[T=DT_FLOAT, _class=[\"loc:@ssd_300_vgg/block11_box/conv_cls/weights\"], use_locking=true, validate_shape=true, _device=\"/job:localhost/replica:0/task:0/cpu:0\"](ssd_300_vgg/block11_box/conv_cls/weights, save_1/RestoreV2_13)]]\r\n\r\nCaused by op u'save_1/Assign_13', defined at:\r\n  File \"/data2/KYJ/SSD-Tensorflow-master/train_ssd_network.py\", line 400, in <module>\r\n    tf.app.run(main=main)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py\", line 44, in run\r\n    _sys.exit(main(_sys.argv[:1] + flags_passthrough))\r\n  File \"/data2/KYJ/SSD-Tensorflow-master/train_ssd_network.py\", line 385, in main\r\n    init_fn=tf_utils.get_init_fn(FLAGS),\r\n  File \"/data2/KYJ/SSD-Tensorflow-master/tf_utils.py\", line 235, in get_init_fn\r\n    ignore_missing_vars=flags.ignore_missing_vars)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/framework/python/ops/variables.py\", line 584, in assign_from_checkpoint_fn\r\n    saver = tf_saver.Saver(var_list, reshape=reshape_variables)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py\", line 1040, in __init__\r\n    self.build()\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py\", line 1070, in build\r\n    restore_sequentially=self._restore_sequentially)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py\", line 675, in build\r\n    restore_sequentially, reshape)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py\", line 414, in _AddRestoreOps\r\n    assign_ops.append(saveable.restore(tensors, shapes))\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py\", line 155, in restore\r\n    self.op.get_shape().is_fully_defined())\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_state_ops.py\", line 47, in assign\r\n    use_locking=use_locking, name=name)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py\", line 763, in apply_op\r\n    op_def=op_def)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py\", line 2327, in create_op\r\n    original_op=self._default_original_op, op_def=op_def)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py\", line 1226, in __init__\r\n    self._traceback = _extract_stack()\r\n\r\nInvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [3,3,256,24] rhs shape= [3,3,256,84]\r\n\t [[Node: save_1/Assign_13 = Assign[T=DT_FLOAT, _class=[\"loc:@ssd_300_vgg/block11_box/conv_cls/weights\"], use_locking=true, validate_shape=true, _device=\"/job:localhost/replica:0/task:0/cpu:0\"](ssd_300_vgg/block11_box/conv_cls/weights, save_1/RestoreV2_13)]]\r\n\r\nTraceback (most recent call last):\r\n  File \"/data2/KYJ/SSD-Tensorflow-master/train_ssd_network.py\", line 400, in <module>\r\n    tf.app.run(main=main)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py\", line 44, in run\r\n    _sys.exit(main(_sys.argv[:1] + flags_passthrough))\r\n  File \"/data2/KYJ/SSD-Tensorflow-master/train_ssd_network.py\", line 393, in main\r\n    sync_optimizer=None)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/learning.py\", line 776, in train\r\n    master, start_standard_services=False, config=session_config) as sess:\r\n  File \"/usr/lib/python2.7/contextlib.py\", line 17, in __enter__\r\n    return self.gen.next()\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/supervisor.py\", line 960, in managed_session\r\n    self.stop(close_summary_writer=close_summary_writer)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/supervisor.py\", line 788, in stop\r\n    stop_grace_period_secs=self._stop_grace_secs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/coordinator.py\", line 386, in join\r\n    six.reraise(*self._exc_info_to_raise)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/supervisor.py\", line 949, in managed_session\r\n    start_standard_services=start_standard_services)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/supervisor.py\", line 706, in prepare_or_wait_for_session\r\n    init_feed_dict=self._init_feed_dict, init_fn=self._init_fn)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/session_manager.py\", line 264, in prepare_session\r\n    init_fn(sess)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/framework/python/ops/variables.py\", line 586, in callback\r\n    saver.restore(session, model_path)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py\", line 1428, in restore\r\n    {self.saver_def.filename_tensor_name: save_path})\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py\", line 767, in run\r\n    run_metadata_ptr)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py\", line 965, in _run\r\n    feed_dict_string, options, run_metadata)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py\", line 1015, in _do_run\r\n    target_list, options, run_metadata)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py\", line 1035, in _do_call\r\n    raise type(e)(node_def, op, message)\r\ntensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [3,3,256,24] rhs shape= [3,3,256,84]\r\n\t [[Node: save_1/Assign_13 = Assign[T=DT_FLOAT, _class=[\"loc:@ssd_300_vgg/block11_box/conv_cls/weights\"], use_locking=true, validate_shape=true, _device=\"/job:localhost/replica:0/task:0/cpu:0\"](ssd_300_vgg/block11_box/conv_cls/weights, save_1/RestoreV2_13)]]\r\n\r\nCaused by op u'save_1/Assign_13', defined at:\r\n  File \"/data2/KYJ/SSD-Tensorflow-master/train_ssd_network.py\", line 400, in <module>\r\n    tf.app.run(main=main)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py\", line 44, in run\r\n    _sys.exit(main(_sys.argv[:1] + flags_passthrough))\r\n  File \"/data2/KYJ/SSD-Tensorflow-master/train_ssd_network.py\", line 385, in main\r\n    init_fn=tf_utils.get_init_fn(FLAGS),\r\n  File \"/data2/KYJ/SSD-Tensorflow-master/tf_utils.py\", line 235, in get_init_fn\r\n    ignore_missing_vars=flags.ignore_missing_vars)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/framework/python/ops/variables.py\", line 584, in assign_from_checkpoint_fn\r\n    saver = tf_saver.Saver(var_list, reshape=reshape_variables)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py\", line 1040, in __init__\r\n    self.build()\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py\", line 1070, in build\r\n    restore_sequentially=self._restore_sequentially)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py\", line 675, in build\r\n    restore_sequentially, reshape)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py\", line 414, in _AddRestoreOps\r\n    assign_ops.append(saveable.restore(tensors, shapes))\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py\", line 155, in restore\r\n    self.op.get_shape().is_fully_defined())\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_state_ops.py\", line 47, in assign\r\n    use_locking=use_locking, name=name)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py\", line 763, in apply_op\r\n    op_def=op_def)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py\", line 2327, in create_op\r\n    original_op=self._default_original_op, op_def=op_def)\r\n  File \"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py\", line 1226, in __init__\r\n    self._traceback = _extract_stack()\r\n\r\nInvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [3,3,256,24] rhs shape= [3,3,256,84]\r\n\t [[Node: save_1/Assign_13 = Assign[T=DT_FLOAT, _class=[\"loc:@ssd_300_vgg/block11_box/conv_cls/weights\"], use_locking=true, validate_shape=true, _device=\"/job:localhost/replica:0/task:0/cpu:0\"](ssd_300_vgg/block11_box/conv_cls/weights, save_1/RestoreV2_13)]]\r\n\r\nI try train_ssd_network\r\n(ubuntu 14.04, CUDA library libcublas.so.8.0, tensorflow-gpu 1.0.1)\r\n\r\nhttps://github.com/balancap/SSD-Tensorflow/issues/8\r\nI saw issues and i tried under changing.\r\n\r\nI changed nets/ssd_vgg_300.py num_classes = 21 -> 6, no_annotation_label = 21->6  \r\nand when I convert a dataset to TFRecords format,\r\nI changed pascalvoc_2007.py       - ( TRAIN_STATISTICS, TEST_STATISTICS, SPLITS_TO_SIZES, \r\n                                                          NUM_CLASSES, fit my dataset )\r\n                 pascalvoc_common.py - ( VOC_LABELS )\r\n\r\nDo I need to change anything?\r\n\r\nIs this issue related to ' https://github.com/tensorflow/tensorflow/issues/7838 '\r\n\r\nplease cheak this issues\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/balancap/SSD-Tensorflow/issues/comments/381379792","html_url":"https://github.com/balancap/SSD-Tensorflow/issues/88#issuecomment-381379792","issue_url":"https://api.github.com/repos/balancap/SSD-Tensorflow/issues/88","id":381379792,"user":{"login":"mapeng1995","id":34765259,"avatar_url":"https://avatars2.githubusercontent.com/u/34765259?v=4","gravatar_id":"","url":"https://api.github.com/users/mapeng1995","html_url":"https://github.com/mapeng1995","followers_url":"https://api.github.com/users/mapeng1995/followers","following_url":"https://api.github.com/users/mapeng1995/following{/other_user}","gists_url":"https://api.github.com/users/mapeng1995/gists{/gist_id}","starred_url":"https://api.github.com/users/mapeng1995/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapeng1995/subscriptions","organizations_url":"https://api.github.com/users/mapeng1995/orgs","repos_url":"https://api.github.com/users/mapeng1995/repos","events_url":"https://api.github.com/users/mapeng1995/events{/privacy}","received_events_url":"https://api.github.com/users/mapeng1995/received_events","type":"User","site_admin":false},"created_at":"2018-04-15T04:42:57Z","updated_at":"2018-04-15T04:42:57Z","author_association":"NONE","body":"@blacklong617  thanks a lot,your solutions is perfect. But  i have a questions. My dataset only have 5+1 classes which is not the VOC 20+1 classes, and just  60-100 images.When i test the model ,the output in the demo(transform the \"INFO:tensorflow:Restoring parameters from ../logs/model.ckpt-\r\n3165\\n\" to my own model   )is not good .\r\n\r\nMy questions is how to use the checkpoints on my own dataset, or how to fine-tune?\r\n \r\nI also notice the original  train code  checkpoint_exclude_scopes , have you fine-tune using this code?\r\n\r\nThanks a lot to read my questions!"}}
{"actor":{"display_login":"mapeng1995"}}