You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I used python script to save the model into .pb file where the tensors and model were in CUDA. But when I try to run the model using pretrained.cc after instruction workspace.runNetOnce, the program aborted. But the .pb model where the model and tensor in CPU can work as expected. May I have any insight on this issue? Thank you.
The text was updated successfully, but these errors were encountered:
DeviceOption option;
option.set_device_type(CUDA);
new CUDAContext(option);
// Load Squeezenet model
NetDef init_net, predict_net;
init_net.mutable_device_option()->set_device_type(CUDA);
predict_net.mutable_device_option()->set_device_type(CUDA);
// >>> with open(path_to_INIT_NET) as f:
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_init_net, &init_net));
// >>> with open(path_to_PREDICT_NET) as f:
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_predict_net, &predict_net));
// >>> p = workspace.Predictor(init_net, predict_net)
Workspace workspace("tmp");
CAFFE_ENFORCE(workspace.RunNetOnce(init_net));
auto input = workspace.CreateBlob("data")->GetMutable<TensorCUDA>();
input->ResizeLike(tensor);
input->CopyFrom(tensor);
CAFFE_ENFORCE(workspace.RunNetOnce(predict_net));
// >>> results = p.run([img])
auto &output_name = predict_net.external_output(0);
auto output = workspace.GetBlob(output_name)->Get<TensorCUDA>();
The program will fail after CAFFE_ENFORCE(workspace.RunNetOnce(predict_net)); with
Unhandled exception at 0x00007FFB894AA388 in caffe2CPP.exe: Microsoft C++ exception: caffe2::EnforceNotMet at memory location 0x000000F73F30DF50.
Hi, I used python script to save the model into .pb file where the tensors and model were in CUDA. But when I try to run the model using pretrained.cc after instruction workspace.runNetOnce, the program aborted. But the .pb model where the model and tensor in CPU can work as expected. May I have any insight on this issue? Thank you.
The text was updated successfully, but these errors were encountered: