Commit Graph

26 Commits

Author SHA1 Message Date
Yangqing Jia
0276c992b7 translator fix
Summary:
This completes the fix that viswanathgs started in an earlier diff but did not
cover the full Caffe convention. It should have proper guards for all the stuff
that Caffe implies, either supporting it or throwing an explicit exception.

Reviewed By: viswanathgs

Differential Revision: D4751751

fbshipit-source-id: 474e921c33840cff333a631b7b19f881b39ebccd
2017-03-22 15:09:13 -07:00
ezineo
518d36d34b Add PReLU translator
Summary: Closes https://github.com/caffe2/caffe2/pull/171

Differential Revision: D4711877

Pulled By: Yangqing

fbshipit-source-id: 555f733e6eabf351480b7d4398aa05755cc26599
2017-03-15 02:47:03 -07:00
Yangqing Jia
2b4ec53fcb translator fix to solve Aaron's issue
Summary: TSIA. This is actually https://github.com/caffe2/caffe2/pull/135

Reviewed By: bwasti

Differential Revision: D4552417

fbshipit-source-id: 184c085af91b87f88203c565167f66c66f17c05f
2017-02-13 11:19:13 -08:00
Bram Wasti
77fd7c2b6f Make translator work as command line tool
Summary: The initial implementation wasn't working quite right (no const fill of an empty external input)

Reviewed By: viswanathgs

Differential Revision: D4490569

fbshipit-source-id: 1b2a4f612efb3b2685edfe6c683571dd9d01aa4f
2017-02-01 13:14:26 -08:00
Viswanath Sivakumar
eba5299576 Port ROIPool to caffe2 trunk, add CPU implementation
Summary:
Xray is being converted to c2 and ROIPool (needed for detection models) is
missing in c2 trunk. Ported rbgirshick's implementation from experimental with a few
changes:

Also added code for translation in caffe_translate.py

Differential Revision: D4453331

fbshipit-source-id: 7a05a88edec1bd6e806e52dc1e6c55bc75c3149f
2017-01-27 12:59:20 -08:00
Viswanath Sivakumar
ca1ff1ee9b Add Flatten layer, bugfix in InnerProduct
Summary: Uncovered these while converting xray detection model.

Differential Revision: D4461051

fbshipit-source-id: 1654c0d7ed101c8c211a93aed6bb542db1e20e0a
2017-01-26 21:44:35 -08:00
Bram Wasti
9dd1d9428e Made translator work as command line tool
Summary: Might be useful to have a command line version of this. Thoughts?

Reviewed By: Yangqing

Differential Revision: D4456221

fbshipit-source-id: 42dd464c5734c0cfbd4c2b1cb348aef9b269b4c2
2017-01-26 20:29:35 -08:00
Viswanath Sivakumar
a4ba0cceb2 Run memonger to optimize net if needed
Summary: This runs memory optimization on the net.

Differential Revision: D4433788

fbshipit-source-id: 80c3f0568795c2d7a5beb3cdb89a92af91162fef
2017-01-25 15:14:26 -08:00
Bram Wasti
b5424c9646 Enable top-k accuracy option in caffe_translator
Summary: Caffe2 has a topk accuracy op now

Differential Revision: D4450387

fbshipit-source-id: 2d516cc44fb4e814ca901e73746b0364a0584217
2017-01-23 14:29:24 -08:00
Viswanath Sivakumar
be97f491e6 Unbreak caffe_translator for Conv op
Summary:
Minor bug in D4426513 - bias is added
as input blob always. Running it on xray throws "RuntimeError: [enforce fail at operator.cc:25] blob
!= nullptr. op Conv: Encountered a non-existing input blob:
caffe.SpatialConvolution_0_b"

Reviewed By: Yangqing

Differential Revision: D4429231

fbshipit-source-id: 0d3905ea6e87128ec1aa9d0f0a2f43126b1069b1
2017-01-18 14:00:04 -08:00
Viswanath Sivakumar
e67425647a Support bias for Scale layer in caffe_translate
Summary:
Turns out xray models have some independent Scale layers (with bias) besides
the Conv-Scale pairs. We could still fuse it with previous layers with some
work, but for simplicity, including Add op followed by Mul for bias if needed.
We could revisit optimizations layer fusion in the future once we have
something working for xray.

Reviewed By: Yangqing

Differential Revision: D4427266

fbshipit-source-id: ef7d8677ccd7d10dbd20759eeed378d9bc4522d1
2017-01-18 09:59:21 -08:00
Yangqing Jia
bfca2b86c3 Removed the old group convolution code
Summary: Now that we direct support group convolution, this will no longer be needed. I also took the chance to add dilated convolution and also optional bias.

Reviewed By: prigoyal

Differential Revision: D4426513

fbshipit-source-id: eb2bb0aa619f8ff5f732512570f736bc59cd57dd
2017-01-18 00:44:31 -08:00
Viswanath Sivakumar
d63f58013b Throw error in caffe_translator on Scale layer with bias
Summary: Failing fast instead of swallowing the bias term.

Differential Revision: D4419130

fbshipit-source-id: 98ce0af9a20adecfb027ffe8293ff69910873abc
2017-01-17 09:59:20 -08:00
Viswanath Sivakumar
7d6742f2f5 Tool to convert caffe models to c2 + fixes for xray v10
Summary:
Simple tool similar to caffe_translator_test.py for conversion from caffe to
caffe2. The differences are:

There are a couple of issues that need to be fixed as mentioned in
https://our.intern.facebook.com/intern/tasks?t=15424761, especially related to
the 'legacy_pad' field in conv op.

Differential Revision: D4407146

fbshipit-source-id: ec641f6d7e0cf6cdf2eca21f058b4451635d4a56
2017-01-17 08:59:58 -08:00
Yangqing Jia
8683737410 Caffe translator: match torch pooling
Summary: See code comments: legacy is a legend.

Reviewed By: viswanathgs

Differential Revision: D4414447

fbshipit-source-id: 7cd96778bbc00aff053100871f273b2e1b43c973
2017-01-13 10:59:20 -08:00
Yangqing Jia
238ceab825 fbsync. TODO: check if build files need update. 2016-11-15 00:00:46 -08:00
Yangqing Jia
44509f9f91 fbsync: mostly lint changes, added mkl files 2016-10-11 22:45:06 -07:00
Yangqing Jia
b23e51d467 chunky sync 2016-09-06 15:55:19 -07:00
Yangqing Jia
05512d1e10 sync 2016-08-10 11:02:15 -07:00
Yangqing Jia
c15e45c9bb chunky sync again 2016-08-01 20:58:46 -07:00
Yangqing Jia
3c989347d8 caffe translator with added back legacy pooling support 2016-07-28 23:37:02 -07:00
Yangqing Jia
6463eebc7b chunky sync - build scripts to be written 2016-07-21 10:16:42 -07:00
Yangqing Jia
559053d3a8 chunky sync 2016-05-13 14:43:48 -07:00
Yangqing Jia
0521e1d672 notebook rewrite and grammar bugfix 2016-03-10 17:34:31 -08:00
Yangqing Jia
cf7ca23fc1 make caffe2.python build 2016-03-08 16:48:19 -08:00
Yangqing Jia
9ae880bb6f move pycaffe2 to caffe2.python 2016-03-08 15:45:30 -08:00