Skip to content

Commit

Permalink
Added a script to convert pkl model to pb.
Browse files Browse the repository at this point in the history
Summary:
Added a script to convert pkl model to pb.
- Supported Faster R-CNN detection model.
- Supported converting to CPU and GPU model.
- Fused AffineChannel to Conv.
- Verified model after conversion.

Reviewed By: rbgirshick

Differential Revision: D6783633

fbshipit-source-id: 19706d3074a4a784a2161a695d7c534e014ebb3f
  • Loading branch information
newstzpz authored and facebook-github-bot committed Jan 29, 2018
1 parent dd6c661 commit 757d77c
Show file tree
Hide file tree
Showing 3 changed files with 979 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/modeling/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ def GenerateProposals(self, blobs_in, blobs_out, anchors, spatial_scale):
(extracted from rpn_cls_probs; see above).
"""
name = 'GenerateProposalsOp:' + ','.join([str(b) for b in blobs_in])
# spatial_scale passed to the Python op is only used in convert_pkl_to_pb
self.net.Python(
GenerateProposalsOp(anchors, spatial_scale, self.train).forward
)(blobs_in, blobs_out, name=name)
)(blobs_in, blobs_out, name=name, spatial_scale=spatial_scale)
return blobs_out

def GenerateProposalLabels(self, blobs_in):
Expand Down
Loading

0 comments on commit 757d77c

Please sign in to comment.