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

Yolov2 training and loss function #7

Open
simo23 opened this issue Aug 31, 2017 · 0 comments
Open

Yolov2 training and loss function #7

simo23 opened this issue Aug 31, 2017 · 0 comments

Comments

@simo23
Copy link

simo23 commented Aug 31, 2017

Hi everyone! First of all thanks @ruiminshen for the amazing work.

I've been studying your code for a while now and I could not get the training work when using the yolov2 tiny model. In particular I wanted to ask you about the yolov2 loss function. When you are extracting the values just computed by the forward pass here:

inputs = tf.reshape(net, [-1, cells, len(anchors), 5 + classes], name='inputs')
inputs_sigmoid = tf.nn.sigmoid(inputs[:, :, :, :3], name=name)
self.iou = tf.identity(inputs_sigmoid[:, :, :, 0], name='iou')
self.offset_xy = tf.identity(inputs_sigmoid[:, :, :, 1:3], name='offset_xy')
self.wh = tf.identity(tf.exp(inputs[:, :, :, 3:5]) * np.reshape(anchors, [1, 1, len(anchors), -1]), name=name)
self.prob = tf.identity(tf.nn.softmax(inputs[:, :, :, 5:]), `name=name)

Are you sure about the values that you are picking with inputs[:,:,:,values]?

I've implemented a model that can perform the forward pass of the tiny-yolov2 and I can say that in inputs you will have:

inputs[:,:,:,:5] = t_x , t_y , t_w, t_h , t_objectness
inputs[:,:,:,5:] = scores of the 20 classes

In your code you seem to take values from different positions, like the first value inputs[:,:,:,0] for 'iou' and also the others don't seem to match what the network is predicting.

Can you please explain your choices? Thank you very much. By the way, have you been able to train the model? @TaihuLight can you explain how you trained the model please?

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

1 participant