diff --git a/mindspore/ccsrc/plugin/device/gpu/hal/hardware/gpu_inference_session.cc b/mindspore/ccsrc/plugin/device/gpu/hal/hardware/gpu_inference_session.cc index 5521e1bf642..831238abff7 100644 --- a/mindspore/ccsrc/plugin/device/gpu/hal/hardware/gpu_inference_session.cc +++ b/mindspore/ccsrc/plugin/device/gpu/hal/hardware/gpu_inference_session.cc @@ -46,6 +46,7 @@ void GpuInferenceSession::LoadInputData(const std::shared_ptr &kern MS_EXCEPTION_IF_NULL(device_address); if (!common::AnfAlgo::IsParameterWeight(pk_node)) { tensor = inputs[no_weight_input++]; + MS_EXCEPTION_IF_NULL(tensor); if (!device_address->SyncHostToDevice(trans::GetRuntimePaddingShape(pk_node, 0), LongToSize(tensor->data().nbytes()), tensor->data_type(), tensor->data_c())) {