hosang / gossipnet

Non-maximum suppression for object detection in a neural network
Other
79 stars 25 forks source link

Problem with Makefile #8

Open Firyuza opened 6 years ago

Firyuza commented 6 years ago

Hello! I did make and in terminal I just saw the warnings, no errors. But when I tried to debug train.py I get such error: tensorflow.python.framework.errors_impl.NotFoundError: ~/nms_net/roi_pooling_layer/roi_pooling.so: undefined symbol: _ZN10tensorflow7strings6StrCatB5cxx11ERKNS0_8AlphaNumE

Thanks!

hosang commented 6 years ago

Sounds like you have linking problems. Can you double check you're linking to the tensorflow you're running it in?

Firyuza commented 6 years ago

I changed this variable TF_INC="/home/firiuza/anaconda3/envs/yad2k/lib/python3.6/site-packages/tensorflow/include" in Makefile. So I think I have the right link.

Thanks!

EkaterinaPogodina commented 6 years ago

@Firyuza Did you fix the problem?

Firyuza commented 6 years ago

@EkaterinaPogodina Unfortunately, I couldn't fix it. But I converted this C++ code that requires build into Tensorflow.

hosang commented 6 years ago

You did the matching with tf ops? Sounds great! Can you share that?

gudovskiy commented 6 years ago

I had to compile roi pooling layer with "-D_GLIBCXX_USE_CXX11_ABI=0" parameter due to GCC version >= 5 to avoid this issue.

Firyuza commented 6 years ago

@hosang I'm not sure that I did right conversion, but I tested it and it works. Hope you will understand my code, because it's not so easy to read :(

matching loss

find the ground truth box for each detection that has maximum IoU

max_ious = tf.reduce_max(self.det_anno_iou, axis=1)
iou_threshold = tf.fill(tf.shape(max_ious), 0.5)

add extra item at the end of tensor for labels and weights

gt_crowd_added = tf.concat([tf.expand_dims(self.gt_crowd, 1), tf.expand_dims([tf.constant(False)], 1)],
                           axis=0)
gt_crowd_added = tf.reshape(gt_crowd_added, [-1])

save indices of ground truth that match to detections

no_matched =  tf.fill(tf.shape(max_ious), tf.constant(-1, dtype=tf.int64))
self.det_gt_matching = tf.where(tf.greater(max_ious, iou_threshold),
                                tf.argmax(self.det_anno_iou, axis=1),
                                no_matched)

add extra item at the end of tensor for labels and weights

extra_ids = tf.fill(tf.shape(max_ious),
                                         tf.cast(tf.shape(self.gt_crowd)[0], dtype=tf.int64))
det_gt_matching_added = tf.where(tf.greater(max_ious, iou_threshold),
                                 tf.argmax(self.det_anno_iou, axis=1),
                                 extra_ids)
self.labels = tf.where(tf.not_equal(det_gt_matching_added, extra_ids),
                       tf.ones_like(max_ious, dtype=tf.float32),
                       tf.zeros_like(max_ious, dtype=tf.float32))
self.weights = tf.where(tf.gather(gt_crowd_added, det_gt_matching_added),
                        tf.zeros_like(max_ious),
                        tf.ones_like(max_ious))
AshStuff commented 6 years ago

@hosang is there any dependency on the Tensorflow version ?

amsword commented 5 years ago

I use the following tf version, which fixes a lot of issues. FYI. pip install tensorflow-gpu==0.12.1

symechar commented 5 years ago

@hosang I also have the same error. Is there any dependency on the Tensorflow version?

SchroeterJulien commented 4 years ago

If it is of any help, here is what worked for me (TensorFlow 1.14) Issue #12 .

UpCoder commented 4 years ago

@SchroeterJulien Please see https://github.com/hosang/gossipnet/issues/14, I successfully run the code (TF 1.12.0)