-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
How to run a pytorch-onnx-caffe2 model on GPU? #12702
Comments
Could you try this? with open("init_net.pb",'rb') as f:
init_net = f.read()
with open("predict_net.pb",'rb') as f:
predict_net = f.read()
init_net.RunAllOnGPU() # Added this line.
predict_net.RunAllOnGPU() # Added this line.
p = workspace.Predictor(init_net, predict_net)
img = np.random.randn(1, 3, 128, 128).astype(np.float32)
out = p.run([img]) |
@mhubii No, it still do not work.
|
I have the same issue trying to run Caffe2 model on GPU:
@perrywu1989 Have you found a solution? Thanks! |
any found solution to this issue, Facing similar issue |
zhangguanheng66
added
module: onnx
Related to torch.onnx
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
labels
Jul 21, 2020
The issue here is not with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
envs:
Pytorch of latest version(torch 1.0.0a0+058c12) from source.
|--- install build-in convert-onnx-to-caffe2 tool ---|
Onnx (onnx 1.3.0) from pip
conda python 3.5
First:
I use codes below to convert pytorch to onnx. Works!
After I got ONNX, I convert it to caffe2.Works!
After I got two .pb files, I run them on Caffe2. Works but in CPU model!
Unfortunately, I try many ways to make them run on GPU, but not any works.
For examplse:
it said:
Even I use the codes in comment lines, the error messages are the same.
Is there anyone who knows how to solve this problem? Or how to make a pytorch-onnx-caffe2 model
run on GPU?
Thanks very much!
cc @houseroad @spandantiwari @lara-hdr @BowenBao @neginraoof
The text was updated successfully, but these errors were encountered: