Add the ocr_rec model json (#10240)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/10240

as title

Reviewed By: sf-wind

Differential Revision: D9176522

fbshipit-source-id: 5b92c0b4ed24f96fe7b1321a3ab5ad26dcd3318d
This commit is contained in:
Lingyi Liu
2018-08-05 16:39:12 -07:00
committed by Facebook Github Bot
parent df23bdc82d
commit 7f2e43a084

View File

@ -84,21 +84,15 @@ int main(int argc, char** argv) {
auto workspace = make_shared<caffe2::Workspace>(new caffe2::Workspace());
bool run_on_gpu = backendCudaSet(caffe2::FLAGS_backend);
// support other device type in the future?
caffe2::DeviceType run_dev = run_on_gpu ? caffe2::CUDA : caffe2::CPU;
// Run initialization network.
caffe2::NetDef init_net_def;
CAFFE_ENFORCE(ReadProtoFromFile(caffe2::FLAGS_init_net, &init_net_def));
setDeviceType(&init_net_def, run_dev);
setOperatorEngine(&init_net_def, caffe2::FLAGS_backend);
CAFFE_ENFORCE(workspace->RunNetOnce(init_net_def));
// Run main network.
caffe2::NetDef net_def;
CAFFE_ENFORCE(ReadProtoFromFile(caffe2::FLAGS_net, &net_def));
setDeviceType(&net_def, run_dev);
setOperatorEngine(&net_def, caffe2::FLAGS_backend);
map<string, caffe2::TensorProtos> tensor_protos_map;