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

tiny yolo v3 conversion #30

Closed
chrisrapson opened this issue Jul 30, 2019 · 2 comments
Closed

tiny yolo v3 conversion #30

chrisrapson opened this issue Jul 30, 2019 · 2 comments
Assignees

Comments

@chrisrapson
Copy link

When I use your tool to convert my cfg and weight files to tensorflow models, there seems to be an error. Here is the resulting graph from tensorboard, and I think that the connection down the right hand side should connect to a convolutional block, not a maxpool block. Specifically, convolutional5.
tensorboard_graph

AlexeyAB's explanation of route layers shows yolov2 has a similar connection to a convolutional block.

Also when I tried converting with this similar repo it connects to a convolutional block.

I'm not 100% sure I've understood route blocks correctly, but it could be that you count the input net1 as a block? If so, then you should increment the index (in this case from 8 to 9). Of course that only applies where the route has a positive number.

@sjain-stanford sjain-stanford self-assigned this Jul 30, 2019
@sjain-stanford
Copy link
Collaborator

sjain-stanford commented Jul 30, 2019

@chrisrapson Thanks for reporting this. Indeed, this is an indexing issue. The stack (in DW2TF) stores layers starting with net at index 0, whereas @AlexeyAB's comment clarifies that indexing excludes the first net (placeholder). When route layers (basically concat operation) use relative indexing (negative values), this was not an issue (e.g. yolo-v2). However with absolute indexing (positive values), we're off by one layer (e.g. tiny-yolo-v3).

I've identified a simple fix, but need to verify it doesn't break other use-cases. Will push shortly. Let me know if you see any other issues. Thanks again!

@sjain-stanford
Copy link
Collaborator

I've fixed this by excluding net layer from the stack. Relative indices should work as usual. Absolute indexing starts with the first true layer. Below is the revised yolov3-tiny graph; route layer concatenates convolutional5 and not maxpool4.

This fixes yolov3 and yolov3-tiny conversions, but has no impact on yolov2 (used relative indexing) or yolov2-tiny (no route layers). For those using DW2TF to convert yolov3 or yolov3-tiny, please use the latest release DW2TF-1.2.

@chrisrapson Closing this, please test and feel free to re-open if you see issues.

image

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

2 participants