TensorRT Giving Error while creating engine

Hi ,
i am following below link to Optimize Caffe Models in Python using tensorRT

I have created model in DIGITS.
i am getting below error .

Traceback (most recent call last):
File “mnist-tensorrt.py”, line 33, in
engine = trt.utils.caffe_to_trt_engine(G_LOGGER,MODEL_PROTOTXT,CAFFE_MODEL,1,1 << 20,OUTPUT_LAYERS,trt.infer.DataType.FLOAT)
File “/usr/local/lib/python2.7/dist-packages/tensorrt/utils/_utils.py”, line 319, in caffe_to_trt_engine
layer = network.mark_output(t)
ValueError: invalid null reference in method ‘NetworkDefinition_mark_output’, argument 2 of type ‘nvinfer1::ITensor &’

below is my environment information

TensorRT-3.0.4/
CUDA 8.0
Quadro P5000 GPU Card

how to solve this error .

I would make sure input size is correct, also remove the TEST and TRAIN section in your prototxt file.