i have download the pre-trained Cityscapes model,and put it under ./checkpoints/label2city_1024p/.
it runs successfully with the command:
python test.py --name label2city_1024p --netG local --ngf 32 --resize_or_crop none
I want to accelerate inference by using tensorRT,so i setup tensorRT-4.0.1.6,and execute the folowing command:
python test.py --name label2city_1024p --netG local --ngf 32 --resize_or_crop none --onnx
but it report the following error:
CustomDatasetDataLoader
dataset [AlignedDataset] was created
[libprotobuf ERROR google/protobuf/io/zero_copy_stream_impl.cc:118] close() failed: Bad file descriptor
Traceback (most recent call last):
File "test.py", line 59, in
generated = run_onnx(opt.onnx, opt.data_type, minibatch, [data['label'], data['inst']])
File "/pix2pixHD/run_engine.py", line 157, in run_onnx
trt_builder.set_max_batch_size(max_batch_size)
NameError: global name 'max_batch_size' is not defined
so i set max_batch_size as 64, max_workspace_size as 100000000,and execute the command again,it report the following error:
CustomDatasetDataLoader
dataset [AlignedDataset] was created
[libprotobuf ERROR google/protobuf/io/zero_copy_stream_impl.cc:118] close() failed: Bad file descriptor
------------------- Running FP32 -----------------------------
----- Builder is Done -----
----- Creating Engine -----
[TensorRT] ERROR: Network must have at least one output
----- Engine is built -----
Traceback (most recent call last):
File "test.py", line 59, in
generated = run_onnx(opt.onnx, opt.data_type, minibatch, [data['label'], data['inst']])
File "/pix2pixHD/run_engine.py", line 173, in run_onnx
time_inference(engine, bs, inp)
NameError: global name 'engine' is not defined
so i try to change engine to trt_engine, but it report error again, i do't know how not figure it out. the error is:
CustomDatasetDataLoader
dataset [AlignedDataset] was created
[libprotobuf ERROR google/protobuf/io/zero_copy_stream_impl.cc:118] close() failed: Bad file descriptor
------------------- Running FP32 -----------------------------
----- Builder is Done -----
----- Creating Engine -----
[TensorRT] ERROR: Network must have at least one output
----- Engine is built -----
Traceback (most recent call last):
File "test.py", line 59, in
generated = run_onnx(opt.onnx, opt.data_type, minibatch, [data['label'], data['inst']])
File "/pix2pixHD/run_engine.py", line 173, in run_onnx
time_inference(trt_engine, bs, inp)
File "/pix2pixHD/run_engine.py", line 108, in time_inference
for io in get_input_output_names(engine):
File "/pix2pixHD/run_engine.py", line 63, in get_input_output_names
nbindings = trt_engine.get_nb_bindings();
AttributeError: 'NoneType' object has no attribute 'get_nb_bindings'
i have download the pre-trained Cityscapes model,and put it under ./checkpoints/label2city_1024p/. it runs successfully with the command: python test.py --name label2city_1024p --netG local --ngf 32 --resize_or_crop none I want to accelerate inference by using tensorRT,so i setup tensorRT-4.0.1.6,and execute the folowing command: python test.py --name label2city_1024p --netG local --ngf 32 --resize_or_crop none --onnx but it report the following error:
CustomDatasetDataLoader dataset [AlignedDataset] was created [libprotobuf ERROR google/protobuf/io/zero_copy_stream_impl.cc:118] close() failed: Bad file descriptor Traceback (most recent call last): File "test.py", line 59, in
generated = run_onnx(opt.onnx, opt.data_type, minibatch, [data['label'], data['inst']])
File "/pix2pixHD/run_engine.py", line 157, in run_onnx
trt_builder.set_max_batch_size(max_batch_size)
NameError: global name 'max_batch_size' is not defined
so i set max_batch_size as 64, max_workspace_size as 100000000,and execute the command again,it report the following error:
CustomDatasetDataLoader dataset [AlignedDataset] was created [libprotobuf ERROR google/protobuf/io/zero_copy_stream_impl.cc:118] close() failed: Bad file descriptor ------------------- Running FP32 ----------------------------- ----- Builder is Done ----- ----- Creating Engine ----- [TensorRT] ERROR: Network must have at least one output ----- Engine is built ----- Traceback (most recent call last): File "test.py", line 59, in
generated = run_onnx(opt.onnx, opt.data_type, minibatch, [data['label'], data['inst']])
File "/pix2pixHD/run_engine.py", line 173, in run_onnx
time_inference(engine, bs, inp)
NameError: global name 'engine' is not defined
so i try to change engine to trt_engine, but it report error again, i do't know how not figure it out. the error is:
CustomDatasetDataLoader dataset [AlignedDataset] was created [libprotobuf ERROR google/protobuf/io/zero_copy_stream_impl.cc:118] close() failed: Bad file descriptor ------------------- Running FP32 ----------------------------- ----- Builder is Done ----- ----- Creating Engine ----- [TensorRT] ERROR: Network must have at least one output ----- Engine is built ----- Traceback (most recent call last): File "test.py", line 59, in
generated = run_onnx(opt.onnx, opt.data_type, minibatch, [data['label'], data['inst']])
File "/pix2pixHD/run_engine.py", line 173, in run_onnx
time_inference(trt_engine, bs, inp)
File "/pix2pixHD/run_engine.py", line 108, in time_inference
for io in get_input_output_names(engine):
File "/pix2pixHD/run_engine.py", line 63, in get_input_output_names
nbindings = trt_engine.get_nb_bindings();
AttributeError: 'NoneType' object has no attribute 'get_nb_bindings'