Open vansin opened 1 year ago
Did you install onnxruntime-gpu? Note that gpu support are not included in the default onnxruntime package.
I get similar error when trying onnx inference with GPU. I have installed onnxruntime-gpu and also checked it with onnxruntime.get_device()
: GPU
io_binding.bind_input(
File "/home/anaconda3/envs/test/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 456, in bind_input
self._iobinding.bind_input(
RuntimeError: Error when binding input: There's no data transfer registered for copying tensors from Device:[DeviceType:1 MemoryType:0 DeviceId:0] to Device:[DeviceType:0 MemoryType:0 DeviceId:0]
Code:
providers = ['CUDAExecutionProvider']
sess = ort.InferenceSession(onnx_file, providers=providers)
output_names = [_.name for _ in sess.get_outputs()]
io_binding = sess.io_binding()
io_binding.bind_input(
name='input',
device_type=device,
device_id=0,
element_type=np.float32,
shape=input_data.shape,
buffer_ptr=input_data.data_ptr())
for name in output_names:
io_binding.bind_output(name) #Error here
sess.run_with_iobinding(io_binding)
ort_outputs = io_binding.copy_outputs_to_cpu()
I meet a same issue while i tried to run onnx inference, have you figure it out?
Did you install onnxruntime-gpu? Note that gpu support are not included in the default onnxruntime package.
Did you mean pip install onnxruntime-gpu
? I tried , but failed
when I pip uninstall onnxruntime
, It works!!
I meet a same issue while i tried to run onnx inference, have you figure it out? @BUAAwolfie @satpalsr did you solve the problem
Checklist
Describe the bug
add
--device cuda:0
failed, and remove can successReproduction
add
--device cuda:0
failed,remove successEnvironment