Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run test_net? (to get the mAP of my task) #3

Open
BestSongEver opened this issue Jun 23, 2017 · 6 comments
Open

How to run test_net? (to get the mAP of my task) #3

BestSongEver opened this issue Jun 23, 2017 · 6 comments

Comments

@BestSongEver
Copy link

BestSongEver commented Jun 23, 2017

Hi
Thx for your excellent job! I'm a new learner and it benefits me a lot.
I notice that there is no test_net.py in FPN/faster_rcnn/

So, could u tell me how to run a test? I neet to know the mAP of my task.

When i use the test_net.py from another project, there gose an error
Traceback (most recent call last):
File "faster_rcnn/test_net.py", line 85, in
network = get_network(args.network_name)
File "faster_rcnn/../lib/networks/factory.py", line 19, in get_network
return FPN_test()
File "faster_rcnn/../lib/networks/FPN_test.py", line 25, in init
self.setup()
File "faster_rcnn/../lib/networks/FPN_test.py", line 231, in setup
.fc(n_classes, relu=False, name='cls_score')
File "faster_rcnn/../lib/networks/network.py", line 34, in layer_decorated
layer_output = op(self, layer_input, *args, **kwargs)
File "faster_rcnn/../lib/networks/network.py", line 390, in fc
dim *= d
TypeError: unsupported operand type(s) for *=: 'int' and 'NoneType'

How can i fix this?

Thx again :)
@xmyqsh

@BestSongEver BestSongEver changed the title How to run test_net? How to run test_net? (to get the mAP of my task) Jun 23, 2017
@chl916185
Copy link

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/script_ops.py", line 85, in call
ret = func(*args)
File "./faster_rcnn/../lib/rpn_msr/anchor_target_layer.py", line 144, in anchor_target_layer
gt_argmax_overlaps = overlaps.argmax(axis=0) # G
ValueError: attempt to get argmax of an empty sequence

When I met the above training VOC2007 error, how do you solve?@
@xmyqsh @BestSongEver

@chl916185
Copy link

how do you solve this problem?
@BestSongEver

@BestSongEver
Copy link
Author

Sorry, i never met this issue. But i just checked it on google.
It might caused by "Because the ratio of images width and heights is too small or large"
Hope it helpful. @chl916185

@chl916185
Copy link

Thank you, it is really inappropriate three pictures, I didn't use them, problem solved, but How to run test_net.py? I met the same problem with you.
Traceback (most recent call last):
File "./faster_rcnn/test_net.py", line 83, in
network = get_network(args.network_name)
File "./faster_rcnn/../lib/networks/factory.py", line 19, in get_network
return FPN_test()
File "./faster_rcnn/../lib/networks/FPN_test.py", line 25, in init
self.setup()
File "./faster_rcnn/../lib/networks/FPN_test.py", line 231, in setup
.fc(n_classes, relu=False, name='cls_score')
File "./faster_rcnn/../lib/networks/network.py", line 34, in layer_decorated
layer_output = op(self, layer_input, args, **kwargs)
File "./faster_rcnn/../lib/networks/network.py", line 391, in fc
dim = dim
d
TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'
@BestSongEver

@xmyqsh
Copy link
Owner

xmyqsh commented Jul 20, 2017

@chl916185 @BestSongEver
hi there,
I've updated anchors filtering logic in proposal target layer to cope with the problem encountered in low h/w ratio images

I will check the test_net latter

@chl916185
Copy link

chl916185 commented Jul 24, 2017

When i use the test_net.py from another project, there gose an error:

(<tf.Tensor 'rpn_rois/rpn_rois_P2:0' shape=(?, 5) dtype=float32>, <tf.Tensor 'rpn_rois/rpn_rois_P3:0' shape=(?, 5) dtype=float32>, <tf.Tensor 'rpn_rois/rpn_rois_P4:0' shape=(?, 5) dtype=float32>, <tf.Tensor 'rpn_rois/rpn_rois_P5:0' shape=(?, 5) dtype=float32>)
[<tf.Tensor 'P2/BiasAdd:0' shape=(?, ?, ?, 256) dtype=float32>, <tf.Tensor 'P3/BiasAdd:0' shape=(?, ?, ?, 256) dtype=float32>, <tf .Tensor 'P4/BiasAdd:0' shape=(?, ?, ?, 256) dtype=float32>, <tf.Tensor 'P5/BiasAdd:0' shape=(?, ?, ?, 256) dtype=float32>, (<tf.Te nsor 'rpn_rois/rpn_rois_P2:0' shape=(?, 5) dtype=float32>, <tf.Tensor 'rpn_rois/rpn_rois_P3:0' shape=(?, 5) dtype=float32>, <tf.Te nsor 'rpn_rois/rpn_rois_P4:0' shape=(?, 5) dtype=float32>, <tf.Tensor 'rpn_rois/rpn_rois_P5:0' shape=(?, 5) dtype=float32>)]
Traceback (most recent call last):
File "./faster_rcnn/test_net.py", line 78, in
network = get_network(args.network_name)
File "./faster_rcnn/../lib/networks/factory.py", line 19, in get_network
return FPN_test()
File "./faster_rcnn/../lib/networks/FPN_test.py", line 25, in init
self.setup()
File "./faster_rcnn/../lib/networks/FPN_test.py", line 354, in setup
.fc(n_classes, relu=False, name='cls_score')
File "./faster_rcnn/../lib/networks/network.py", line 34, in layer_decorated
layer_output = op(self, layer_input, *args, **kwargs)
File "./faster_rcnn/../lib/networks/network.py", line 405, in fc
regularizer=self.l2_regularizer(cfg.TRAIN.WEIGHT_DECAY))
File "./faster_rcnn/../lib/networks/network.py", line 96, in make_var
return tf.get_variable(name, shape, initializer=initializer, trainable=trainable, regularizer=regularizer)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 988, in get_variable
custom_getter=custom_getter)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 890, in get_variable
custom_getter=custom_getter)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 348, in get_variable
validate_shape=validate_shape)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 333, in _true_getter
caching_device=caching_device, validate_shape=validate_shape)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 639, in _get_single_variable
name, "".join(traceback.format_list(tb))))
ValueError: Variable cls_score/weights already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:

File "./faster_rcnn/../lib/networks/network.py", line 96, in make_var
return tf.get_variable(name, shape, initializer=initializer, trainable=trainable, regularizer=regularizer)
File "./faster_rcnn/../lib/networks/network.py", line 405, in fc
regularizer=self.l2_regularizer(cfg.TRAIN.WEIGHT_DECAY))
File "./faster_rcnn/../lib/networks/network.py", line 34, in layer_decorated
layer_output = op(self, layer_input, *args, **kwargs)
When I was loading the trained model:
network_name = 'FPN_test'
network = get_network(network_name)
print 'Use network {:s} in training'.format(network_name)
@BestSongEver @xmyqsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants