{"action":"created","issue":{"url":"https://api.github.com/repos/endernewton/tf-faster-rcnn/issues/383","repository_url":"https://api.github.com/repos/endernewton/tf-faster-rcnn","labels_url":"https://api.github.com/repos/endernewton/tf-faster-rcnn/issues/383/labels{/name}","comments_url":"https://api.github.com/repos/endernewton/tf-faster-rcnn/issues/383/comments","events_url":"https://api.github.com/repos/endernewton/tf-faster-rcnn/issues/383/events","html_url":"https://github.com/endernewton/tf-faster-rcnn/issues/383","id":356193460,"node_id":"MDU6SXNzdWUzNTYxOTM0NjA=","number":383,"title":"how to change the feat_stride?","user":{"login":"ReneWu1117","id":19515625,"node_id":"MDQ6VXNlcjE5NTE1NjI1","avatar_url":"https://avatars0.githubusercontent.com/u/19515625?v=4","gravatar_id":"","url":"https://api.github.com/users/ReneWu1117","html_url":"https://github.com/ReneWu1117","followers_url":"https://api.github.com/users/ReneWu1117/followers","following_url":"https://api.github.com/users/ReneWu1117/following{/other_user}","gists_url":"https://api.github.com/users/ReneWu1117/gists{/gist_id}","starred_url":"https://api.github.com/users/ReneWu1117/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReneWu1117/subscriptions","organizations_url":"https://api.github.com/users/ReneWu1117/orgs","repos_url":"https://api.github.com/users/ReneWu1117/repos","events_url":"https://api.github.com/users/ReneWu1117/events{/privacy}","received_events_url":"https://api.github.com/users/ReneWu1117/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-01T10:58:02Z","updated_at":"2018-09-04T07:51:32Z","closed_at":null,"author_association":"NONE","body":"I want to change feat_stride from 16 to 8, so that model can be more sensitive to small object. And I change:\r\n`self._feat_stride = [16, ]`\r\nto\r\n`self._feat_stride = [8, ]`\r\nBut that's not enough, I get error as follow:\r\n```\r\n2018-09-01 18:46:33.846993: W tensorflow/core/framework/op_kernel.cc:1263] Invalid argument: exceptions.ValueError: cannot reshape array of size 116400 into shape (1,38,49,16)\r\nTraceback (most recent call last):\r\n\r\n  File \"/home/rene/.local/lib/python2.7/site-packages/tensorflow/python/ops/script_ops.py\", line 206, in __call__\r\n    ret = func(*args)\r\n\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/layer_utils/anchor_target_layer.py\", line 136, in anchor_target_layer\r\n    labels = labels.reshape((1, height, width, A)).transpose(0, 3, 1, 2)\r\n\r\nValueError: cannot reshape array of size 116400 into shape (1,38,49,16)\r\n\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/trainval_net.py\", line 159, in <module>\r\n    max_iters=args.max_iters)\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/model/train_val.py\", line 404, in train_net\r\n    sw.train_model(sess, max_iters)\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/model/train_val.py\", line 300, in train_model\r\n    self.net.train_step_with_summary(sess, blobs, train_op)\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/nets/network.py\", line 686, in train_step_with_summary\r\n    feed_dict=feed_dict)\r\n  File \"/home/rene/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py\", line 877, in run\r\n    run_metadata_ptr)\r\n  File \"/home/rene/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py\", line 1100, in _run\r\n    feed_dict_tensor, options, run_metadata)\r\n  File \"/home/rene/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py\", line 1272, in _do_run\r\n    run_metadata)\r\n  File \"/home/rene/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py\", line 1291, in _do_call\r\n    raise type(e)(node_def, op, message)\r\ntensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [29792] vs. [116400]\r\n\t [[Node: resnet_v1_101_3/rois/Mul_2 = Mul[T=DT_FLOAT, _device=\"/job:localhost/replica:0/task:0/device:GPU:0\"](resnet_v1_101_3/rois/strided_slice_7, resnet_v1_101_3/rois/add)]]\r\n\r\nCaused by op u'resnet_v1_101_3/rois/Mul_2', defined at:\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/trainval_net.py\", line 159, in <module>\r\n    max_iters=args.max_iters)\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/model/train_val.py\", line 404, in train_net\r\n    sw.train_model(sess, max_iters)\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/model/train_val.py\", line 260, in train_model\r\n    lr, train_op = self.construct_graph(sess)\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/model/train_val.py\", line 129, in construct_graph\r\n    anchor_ratios=cfg.ANCHOR_RATIOS)\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/nets/network.py\", line 568, in create_architecture\r\n    rois, cls_prob, bbox_pred = self._build_network(training)\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/nets/network.py\", line 280, in _build_network\r\n    rois = self._region_proposal(net_conv, is_training, initializer)\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/nets/network.py\", line 453, in _region_proposal\r\n    rois, roi_scores = self._proposal_layer(rpn_cls_prob, rpn_bbox_pred, \"rois\")\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/nets/network.py\", line 126, in _proposal_layer\r\n    self._num_anchors\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/layer_utils/proposal_layer.py\", line 85, in proposal_layer_tf\r\n    proposals = bbox_transform_inv_tf(anchors, rpn_bbox_pred)\r\n  File \"/home/rene/code/tf-faster-rcnn/tools/../lib/model/bbox_transform.py\", line 141, in bbox_transform_inv_tf\r\n    pred_ctr_x = tf.add(tf.multiply(dx, widths), ctr_x)\r\n  File \"/home/rene/.local/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.py\", line 203, in multiply\r\n    return gen_math_ops.mul(x, y, name)\r\n  File \"/home/rene/.local/lib/python2.7/site-packages/tensorflow/python/ops/gen_math_ops.py\", line 4936, in mul\r\n    \"Mul\", x=x, y=y, name=name)\r\n  File \"/home/rene/.local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py\", line 787, in _apply_op_helper\r\n    op_def=op_def)\r\n  File \"/home/rene/.local/lib/python2.7/site-packages/tensorflow/python/util/deprecation.py\", line 454, in new_func\r\n    return func(*args, **kwargs)\r\n  File \"/home/rene/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py\", line 3155, in create_op\r\n    op_def=op_def)\r\n  File \"/home/rene/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py\", line 1717, in __init__\r\n    self._traceback = tf_stack.extract_stack()\r\n\r\nInvalidArgumentError (see above for traceback): Incompatible shapes: [29792] vs. [116400]\r\n\t [[Node: resnet_v1_101_3/rois/Mul_2 = Mul[T=DT_FLOAT, _device=\"/job:localhost/replica:0/task:0/device:GPU:0\"](resnet_v1_101_3/rois/strided_slice_7, resnet_v1_101_3/rois/add)]]\r\n```\r\nI found the old version had `__C.DEDUP_BOXES`, but now it seem to be abandoned. So how can I change the the feat_stride now?\r\nAny suggestions will be helpful."},"comment":{"url":"https://api.github.com/repos/endernewton/tf-faster-rcnn/issues/comments/418274341","html_url":"https://github.com/endernewton/tf-faster-rcnn/issues/383#issuecomment-418274341","issue_url":"https://api.github.com/repos/endernewton/tf-faster-rcnn/issues/383","id":418274341,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODI3NDM0MQ==","user":{"login":"rnsandeep","id":6125197,"node_id":"MDQ6VXNlcjYxMjUxOTc=","avatar_url":"https://avatars0.githubusercontent.com/u/6125197?v=4","gravatar_id":"","url":"https://api.github.com/users/rnsandeep","html_url":"https://github.com/rnsandeep","followers_url":"https://api.github.com/users/rnsandeep/followers","following_url":"https://api.github.com/users/rnsandeep/following{/other_user}","gists_url":"https://api.github.com/users/rnsandeep/gists{/gist_id}","starred_url":"https://api.github.com/users/rnsandeep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnsandeep/subscriptions","organizations_url":"https://api.github.com/users/rnsandeep/orgs","repos_url":"https://api.github.com/users/rnsandeep/repos","events_url":"https://api.github.com/users/rnsandeep/events{/privacy}","received_events_url":"https://api.github.com/users/rnsandeep/received_events","type":"User","site_admin":false},"created_at":"2018-09-04T07:51:32Z","updated_at":"2018-09-04T07:51:32Z","author_association":"NONE","body":"I have change the feature stride to 8 and added an deconv layer after net_conv ( image_to_head) to double the size of feature map. The original feature map was intended only for feature stride of 16. In order to use 8 you have to double the feature map size. Instead of removing the net_conv layer you can add deconv layer to make it work."}}
{"actor":{"display_login":"rnsandeep"}}