FastMaskRCNN icon indicating copy to clipboard operation
FastMaskRCNN copied to clipboard

ROIAlign wrong??

Open 1145520074 opened this issue 8 years ago • 5 comments

when I run data_test.py, it went wrong as follows:

Traceback (most recent call last): File "unit_test/data_test.py", line 48, in feat = ROIAlign(image, boxes, False, 16, 7, 7) File "unit_test/../libs/layers/crop.py", line 42, in crop with tf.control_dependencies([assert_op, images, batch_inds]): File "/home/tuku/.jumbo/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3595, in control_dependencies return get_default_graph().control_dependencies(control_inputs) File "/home/tuku/.jumbo/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3324, in control_dependencies c = self.as_graph_element(c) File "/home/tuku/.jumbo/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2414, in as_graph_element return self._as_graph_element_locked(obj, allow_tensor, allow_operation) File "/home/tuku/.jumbo/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2503, in _as_graph_element_locked % (type(obj).name, types_str)) TypeError: Can not convert a bool into a Tensor or Operation.

Can anyone tell me why?thanks

1145520074 avatar May 10 '17 06:05 1145520074

I have a similar issue, any ideas? It's not reading the images correctly.

i'm tracking it to down slowly...

stevefoy avatar May 16 '17 15:05 stevefoy

@1145520074 @stevefoy Hello! I have the same error. Did you solve it?

tjussh avatar May 23 '17 12:05 tjussh

hey tjussh,

I just fixed it this way,

boxes = tf.constant(boxes, tf.float32) batch_inds = np.zeros((4,), dtype=np.int32) batch_inds = tf.convert_to_tensor(batch_inds) feat = ROIAlign(image, boxes, batch_inds , 16, 7, 7)

but the this is not a testing the trained network, I'm finding it slow to write the code to actually test the trained network

stevefoy avatar May 23 '17 13:05 stevefoy

I got this error because I incorrectly uncommented parts from the second crop method, instead of the first crop method.

jasonwei20 avatar Sep 20 '17 21:09 jasonwei20

Enabled the below code & it runs fine L.No 34 to 38 of /FastMaskRCNN/libs/layers/crop.py

if batch_inds is False: num_boxes = tf.shape(boxes)[0] batch_inds = tf.zeros([num_boxes], dtype=tf.int32, name='batch_inds') batch_inds = boxes[:, 0] * 0 batch_inds = tf.cast(batch_inds, tf.int32)

mathpopo avatar Nov 27 '18 09:11 mathpopo