Error in TensorRT python yolo2onnx sample , inference appears ' pycuda._driver.LogicError: cuMemcpyHtoDAsync failed: invalid argument'

I train a model using darknet , and the weighe of model trained by my own dataset .it is converted into an engine following the TensorRT python yolo2onnx sample ,but there is an error in doing inference.(the yolov3.weight provided by the sample is right )

 Traceback (most recent call last):
          File "onnx_to_tensorrt.py", line 185, in <module>
            main()
          File "onnx_to_tensorrt.py", line 159, in main
            trt_outputs = common.do_inference(context, bindings=bindings, inputs=inputs, outputs=outputs, stream=stream)
          File "/workspace/tensorrt/samples/python/yolov3_onnx/../common.py", line 169, in do_inference
            [cuda.memcpy_htod_async(inp.device, inp.host, stream) for inp in inputs]
          File "/workspace/tensorrt/samples/python/yolov3_onnx/../common.py", line 169, in <listcomp>
            [cuda.memcpy_htod_async(inp.device, inp.host, stream) for inp in inputs]
        pycuda._driver.LogicError: cuMemcpyHtoDAsync failed: invalid argument

the weight is tested on darknet and has no error to detect.

Solved by changing ‘input_resolution_yolov3_HW’ and output shapes