layerism / TensorRT-Inference-Server-Tutorial

服务侧深度学习部署案例
454 stars 73 forks source link

Segmentation fault (core dumped) #6

Open sondv2 opened 4 years ago

sondv2 commented 4 years ago

environment: Ubuntu 18.04 GPU 1 card 1080ti When i run python network.py and got error:

Traceback (most recent call last): File "network.py", line 62, in int8_calibrator=int8_calibrator File "/home/xxx/anaconda3/envs/tensorrtserver/lib/python3.6/site-packages/trtis-0.1.0-py3.6.egg/trtis/trt_backend/torch2trt.py", line 126, in torch2trt File "/home/xxx/anaconda3/envs/tensorrtserver/lib/python3.6/site-packages/trtis-0.1.0-py3.6.egg/trtis/onnx_backend/torch2onnx.py", line 147, in torch2onnx File "/home/xxx/anaconda3/envs/tensorrtserver/lib/python3.6/site-packages/torch/nn/modules/module.py", line 839, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for WrapperModel: Missing key(s) in state_dict: "model.dla_up.ida_0.proj_1.0.weight", "model.dla_up.ida_0.proj_1.1.weight", "model.dla_up.ida_0.proj_1.1.bias", "model.dla_up.ida_0.proj_1.1.running_mean", "model.dla_up.ida_0.proj_1.1.running_var", "model.dla_up.ida_0.up_1.weight", "model.dla_up.ida_0.node_1.0.weight", "model.dla_up.ida_0.node_1.1.weight", "model.dla_up.ida_0.node_1.1.bias", "model.dla_up.ida_0.node_1.1.running_mean", "model.dla_up.ida_0.node_1.1.running_var", "model.dla_up.ida_1.proj_1.0.weight", "model.dla_up.ida_1.proj_1.1.weight", "model.dla_up.ida_1.proj_1.1.bias", "model.dla_up.ida_1.proj_1.1.running_mean", "model.dla_up.ida_1.proj_1.1.running_var", "model.dla_up.ida_1.up_1.weight", "model.dla_up.ida_1.proj_2.0.weight", "model.dla_up.ida_1.proj_2.1.weight", "model.dla_up.ida_1.proj_2.1.bias", "model.dla_up.ida_1.proj_2.1.running_mean", "model.dla_up.ida_1.proj_2.1.running_var", "model.dla_up.ida_1.up_2.weight", "model.dla_up.ida_1.node_1.0.weight", "model.dla_up.ida_1.node_1.1.weight", "model.dla_up.ida_1.node_1.1.bias", "model.dla_up.ida_1.node_1.1.running_mean", "model.dla_up.ida_1.node_1.1.running_var", "model.dla_up.ida_1.node_2.0.weight", "model.dla_up.ida_1.node_2.1.weight", "model.dla_up.ida_1.node_2.1.bias", "model.dla_up.ida_1.node_2.1.running_mean", "model.dla_up.ida_1.node_2.1.running_var", "model.dla_up.ida_2.proj_1.0.weight", "model.dla_up.ida_2.proj_1.1.weight", "model.dla_up.ida_2.proj_1.1.bias", "model.dla_up.ida_2.proj_1.1.running_mean", "model.dla_up.ida_2.proj_1.1.running_var", "model.dla_up.ida_2.up_1.weight", "model.dla_up.ida_2.proj_2.0.weight", "model.dla_up.ida_2.proj_2.1.weight", "model.dla_up.ida_2.proj_2.1.bias", "model.dla_up.ida_2.proj_2.1.running_mean", "model.dla_up.ida_2.proj_2.1.running_var", "model.dla_up.ida_2.up_2.weight", "model.dla_up.ida_2.proj_3.0.weight", "model.dla_up.ida_2.proj_3.1.weight", "model.dla_up.ida_2.proj_3.1.bias", "model.dla_up.ida_2.proj_3.1.running_mean", "model.dla_up.ida_2.proj_3.1.running_var", "model.dla_up.ida_2.up_3.weight", "model.dla_up.ida_2.node_1.0.weight", "model.dla_up.ida_2.node_1.1.weight", "model.dla_up.ida_2.node_1.1.bias", "model.dla_up.ida_2.node_1.1.running_mean", "model.dla_up.ida_2.node_1.1.running_var", "model.dla_up.ida_2.node_2.0.weight", "model.dla_up.ida_2.node_2.1.weight", "model.dla_up.ida_2.node_2.1.bias", "model.dla_up.ida_2.node_2.1.running_mean", "model.dla_up.ida_2.node_2.1.running_var", "model.dla_up.ida_2.node_3.0.weight", "model.dla_up.ida_2.node_3.1.weight", "model.dla_up.ida_2.node_3.1.bias", "model.dla_up.ida_2.node_3.1.running_mean", "model.dla_up.ida_2.node_3.1.running_var", "model.hm.0.weight", "model.hm.0.bias", "model.hm.2.weight", "model.hm.2.bias", "model.wh.0.weight", "model.wh.0.bias", "model.wh.2.weight", "model.wh.2.bias", "model.reg.0.weight", "model.reg.0.bias", "model.reg.2.weight", "model.reg.2.bias".

layerism commented 4 years ago

I think you have to modify a little bit in the torch2onnx.py to match the name in your pth file. The file is in backend/onnx_backend/torch2onnx.py. I didn't carefully handle the name in dla34, many authors will change the layer or re-define the module, it is painful to get each name of layer match.