I also meet this error during calibrate step:
this is my test script:
import os
2 import sys
3 import time
4 from PIL import Image
5
6 import numpy as np
7 import tensorflow as tf
8 from tensorflow.python.compiler.tensorrt import trt_convert as trt
9
10 sys.path.append(“.”)
11 from preprocessing import vgg_preprocess as vgg_preprocessing
12
13 BATCH_SIZE = 8
14 NUM_CALIB_IMAGES = 32
15
16 # SAVED_MODEL_DIR = “…/models/resnet_v1_fp32/saved_model”
17 SAVED_MODEL_DIR = “…/models/ssd_mobilenet-v2/saved_model”
18 INT8_SAVED_MODEL_DIR = SAVED_MODEL_DIR + “_TFTRT_INT8/2”
19
20 data_directory = “…/imagenet-data/Calibration_data”
21
22 calibration_files = [os.path.join(path, name) for path, _, files in os.walk(data_directory) for name in files]
23 print(‘There are %d calibration files. \n%s\n%s\n…’ % (
24 len(calibration_files), calibration_files[0], calibration_files[-1]))
25 calibration_files = calibration_files[:NUM_CALIB_IMAGES]
26
27
28 def parse_file(filepath):
29 image = tf.io.read_file(filepath)
30 image = tf.image.decode_jpeg(image, channels=3)
31 image = vgg_preprocessing(image, 224, 224)
32 return image
33
34
35 def read_image(image_path):
36 image = Image.open(image_path).convert(‘RGB’)
37 image = image.resize(224, 224)
38 return np.array(image)
39
41 num_calibration_batches = 2
prepare calibration dataset
44 dataset = tf.data.Dataset.from_tensor_slices(calibration_files)
45 dataset = dataset.map(map_func=parse_file, num_parallel_calls=20)
46 dataset = dataset.batch(batch_size=BATCH_SIZE)
47 dataset = dataset.repeat(None)
48 calibration_dataset = dataset.take(num_calibration_batches)
49
50
51 def calibration_input_fn():
52 for x in calibration_dataset:
53 ¦ yield (x,)
54
55
56 conversion_params = trt.DEFAULT_TRT_CONVERSION_PARAMS._replace(
57 precision_mode=trt.TrtPrecisionMode.INT8)
58
59 converter = trt.TrtGraphConverterV2(
60 input_saved_model_dir=SAVED_MODEL_DIR,
61 conversion_params=conversion_params)
62
63 converter.convert(calibration_input_fn=calibration_input_fn)
64
65 converter.save(INT8_SAVED_MODEL_DIR)
This is my error message:
There are 64 calibration files.
…/imagenet-data/Calibration_data/ILSVRC2017_test_00000022.JPEG
…/imagenet-data/Calibration_data/ILSVRC2017_test_00000038.JPEG
…
2020-03-19 10:12:50.778300: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2020-03-19 10:12:50.796129: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:50.796481: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce RTX 2080 major: 7 minor: 5 memoryClockRate(GHz): 1.71
pciBusID: 0000:01:00.0
2020-03-19 10:12:50.796490: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2020-03-19 10:12:50.796520: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:50.796825: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:50.797105: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2020-03-19 10:12:50.798116: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:50.798390: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce RTX 2080 major: 7 minor: 5 memoryClockRate(GHz): 1.71
pciBusID: 0000:01:00.0
2020-03-19 10:12:50.798399: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2020-03-19 10:12:50.798427: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:50.798701: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:50.798993: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2020-03-19 10:12:51.132226: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-03-19 10:12:51.132253: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0
2020-03-19 10:12:51.132258: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N
2020-03-19 10:12:51.132362: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:51.132718: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:51.133007: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:51.133293: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6969 MB memory) → physical GPU (device: 0, name: GeForce RTX 2080, pci bus id: 0000:01:00.0, compute capability: 7.5)
2020-03-19 10:12:51.136525: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x16d36b20 executing computations on platform CUDA. Devices:
2020-03-19 10:12:51.136536: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): GeForce RTX 2080, Compute Capability 7.5
2020-03-19 10:12:51.156288: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3696000000 Hz
2020-03-19 10:12:51.156868: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x16e0eff0 executing computations on platform Host. Devices:
2020-03-19 10:12:51.156882: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Host, Default Version
2020-03-19 10:12:56.139345: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:56.139611: I tensorflow/core/grappler/devices.cc:55] Number of eligible GPUs (core count >= 8, compute capability >= 0.0): 1
2020-03-19 10:12:56.139724: I tensorflow/core/grappler/clusters/single_machine.cc:356] Starting new session
2020-03-19 10:12:56.140537: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:56.140791: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce RTX 2080 major: 7 minor: 5 memoryClockRate(GHz): 1.71
pciBusID: 0000:01:00.0
2020-03-19 10:12:56.140798: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2020-03-19 10:12:56.140838: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:56.141085: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:56.141328: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2020-03-19 10:12:56.141359: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-03-19 10:12:56.141364: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0
2020-03-19 10:12:56.141369: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N
2020-03-19 10:12:56.141459: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:56.141716: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:12:56.141963: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6969 MB memory) → physical GPU (device: 0, name: GeForce RTX 2080, pci bus id: 0000:01:00.0, compute capability: 7.5)
2020-03-19 10:12:56.322819: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:716] Optimization results for grappler item: graph_to_optimize
2020-03-19 10:12:56.322850: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] function_optimizer: function_optimizer did nothing. time = 0.002ms.
2020-03-19 10:12:56.322854: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] function_optimizer: function_optimizer did nothing. time = 0ms.
2020-03-19 10:13:00.562811: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:13:00.563086: I tensorflow/core/grappler/devices.cc:55] Number of eligible GPUs (core count >= 8, compute capability >= 0.0): 1
2020-03-19 10:13:00.563566: I tensorflow/core/grappler/clusters/single_machine.cc:356] Starting new session
2020-03-19 10:13:00.564515: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:13:00.564753: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce RTX 2080 major: 7 minor: 5 memoryClockRate(GHz): 1.71
pciBusID: 0000:01:00.0
2020-03-19 10:13:00.564762: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2020-03-19 10:13:00.564791: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:13:00.565027: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:13:00.565258: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2020-03-19 10:13:00.565275: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-03-19 10:13:00.565279: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0
2020-03-19 10:13:00.565283: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N
2020-03-19 10:13:00.565361: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:13:00.565600: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-03-19 10:13:00.565828: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6969 MB memory) → physical GPU (device: 0, name: GeForce RTX 2080, pci bus id: 0000:01:00.0, compute capability: 7.5)
2020-03-19 10:13:02.015354: I tensorflow/compiler/tf2tensorrt/segment/segment.cc:460] There are 3648 ops of 48 different types in the graph that are not converted to TensorRT: TopKV2, Squeeze, Range, Conv2D, TensorArrayWriteV3, Const, Add, Placeholder, Switch, TensorArrayGatherV3, NoOp, NextIteration, Greater, NonMaxSuppressionV2, StridedSlice, Less, TensorArraySizeV3, ExpandDims, Exit, Cast, Identity, Shape, TensorArrayReadV3, Reshape, Merge, LoopCond, TensorArrayV3, Enter, TensorArrayScatterV3, Mul, Equal, Sub, Minimum, Split, ZerosLike, Pack, Size, Unpack, Assert, DataFormatVecPermute, Transpose, Gather, Tile, Fill, Slice, Where, Maximum, ConcatV2, (For more information see Accelerating Inference In TF-TRT User Guide :: NVIDIA Deep Learning Frameworks Documentation).
2020-03-19 10:13:02.057671: I tensorflow/compiler/tf2tensorrt/convert/convert_graph.cc:633] Number of TensorRT candidate segments: 6
2020-03-19 10:13:02.143827: I tensorflow/compiler/tf2tensorrt/convert/convert_graph.cc:734] TensorRT node TRTEngineOp_0 added for segment 0 consisting of 508 nodes succeeded.
2020-03-19 10:13:02.144771: I tensorflow/compiler/tf2tensorrt/convert/convert_graph.cc:734] TensorRT node BoxPredictor_1/ClassPredictor/TRTEngineOp_1 added for segment 1 consisting of 4 nodes succeeded.
2020-03-19 10:13:02.144819: I tensorflow/compiler/tf2tensorrt/convert/convert_graph.cc:734] TensorRT node TRTEngineOp_2 added for segment 2 consisting of 18 nodes succeeded.
2020-03-19 10:13:02.144914: I tensorflow/compiler/tf2tensorrt/convert/convert_graph.cc:734] TensorRT node TRTEngineOp_3 added for segment 3 consisting of 18 nodes succeeded.
2020-03-19 10:13:02.144968: I tensorflow/compiler/tf2tensorrt/convert/convert_graph.cc:734] TensorRT node TRTEngineOp_4 added for segment 4 consisting of 7 nodes succeeded.
2020-03-19 10:13:02.145006: I tensorflow/compiler/tf2tensorrt/convert/convert_graph.cc:734] TensorRT node TRTEngineOp_5 added for segment 5 consisting of 3 nodes succeeded.
2020-03-19 10:13:02.422876: W tensorflow/compiler/tf2tensorrt/convert/trt_optimization_pass.cc:183] TensorRTOptimizer is probably called on funcdef! This optimizer must NOT be called on function objects.
2020-03-19 10:13:02.587558: W tensorflow/compiler/tf2tensorrt/convert/trt_optimization_pass.cc:183] TensorRTOptimizer is probably called on funcdef! This optimizer must NOT be called on function objects.
2020-03-19 10:13:02.648270: W tensorflow/compiler/tf2tensorrt/convert/trt_optimization_pass.cc:183] TensorRTOptimizer is probably called on funcdef! This optimizer must NOT be called on function objects.
2020-03-19 10:13:02.652283: W tensorflow/compiler/tf2tensorrt/convert/trt_optimization_pass.cc:183] TensorRTOptimizer is probably called on funcdef! This optimizer must NOT be called on function objects.
2020-03-19 10:13:02.655959: W tensorflow/compiler/tf2tensorrt/convert/trt_optimization_pass.cc:183] TensorRTOptimizer is probably called on funcdef! This optimizer must NOT be called on function objects.
2020-03-19 10:13:02.659025: W tensorflow/compiler/tf2tensorrt/convert/trt_optimization_pass.cc:183] TensorRTOptimizer is probably called on funcdef! This optimizer must NOT be called on function objects.
2020-03-19 10:13:02.671226: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:716] Optimization results for grappler item: tf_graph
2020-03-19 10:13:02.671257: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 6095 nodes (-1940), 10082 edges (-2174), time = 452.637ms.
2020-03-19 10:13:02.671261: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] layout: Graph size after: 6297 nodes (202), 10284 edges (202), time = 377.836ms.
2020-03-19 10:13:02.671265: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 6127 nodes (-170), 10114 edges (-170), time = 290.92ms.
2020-03-19 10:13:02.671269: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] TensorRTOptimizer: Graph size after: 5575 nodes (-552), 9543 edges (-571), time = 314.315ms.
2020-03-19 10:13:02.671272: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 5574 nodes (-1), 9543 edges (0), time = 221.983ms.
2020-03-19 10:13:02.671275: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:716] Optimization results for grappler item: TRTEngineOp_5_native_segment
2020-03-19 10:13:02.671278: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 10 nodes (0), 9 edges (0), time = 0.443ms.
2020-03-19 10:13:02.671282: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] layout: Graph size after: 10 nodes (0), 9 edges (0), time = 0.163ms.
2020-03-19 10:13:02.671286: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 10 nodes (0), 9 edges (0), time = 0.343ms.
2020-03-19 10:13:02.671291: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] TensorRTOptimizer: Graph size after: 10 nodes (0), 9 edges (0), time = 0.041ms.
2020-03-19 10:13:02.671294: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 10 nodes (0), 9 edges (0), time = 0.424ms.
2020-03-19 10:13:02.671298: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:716] Optimization results for grappler item: TRTEngineOp_0_native_segment
2020-03-19 10:13:02.671302: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 526 nodes (0), 535 edges (0), time = 36.556ms.
2020-03-19 10:13:02.671305: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] layout: Graph size after: 526 nodes (0), 535 edges (0), time = 49.395ms.
2020-03-19 10:13:02.671309: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 526 nodes (0), 535 edges (0), time = 39.263ms.
2020-03-19 10:13:02.671312: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] TensorRTOptimizer: Graph size after: 526 nodes (0), 535 edges (0), time = 5.479ms.
2020-03-19 10:13:02.671315: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 526 nodes (0), 535 edges (0), time = 37.914ms.
2020-03-19 10:13:02.671319: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:716] Optimization results for grappler item: TRTEngineOp_2_native_segment
2020-03-19 10:13:02.671323: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 24 nodes (0), 27 edges (0), time = 0.676ms.
2020-03-19 10:13:02.671326: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] layout: Graph size after: 24 nodes (0), 27 edges (0), time = 0.305ms.
2020-03-19 10:13:02.671329: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 24 nodes (0), 27 edges (0), time = 0.582ms.
2020-03-19 10:13:02.671333: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] TensorRTOptimizer: Graph size after: 24 nodes (0), 27 edges (0), time = 0.067ms.
2020-03-19 10:13:02.671336: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 24 nodes (0), 27 edges (0), time = 0.53ms.
2020-03-19 10:13:02.671339: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:716] Optimization results for grappler item: TRTEngineOp_4_native_segment
2020-03-19 10:13:02.671343: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 14 nodes (0), 13 edges (0), time = 0.359ms.
2020-03-19 10:13:02.671346: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] layout: Graph size after: 14 nodes (0), 13 edges (0), time = 0.217ms.
2020-03-19 10:13:02.671350: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 14 nodes (0), 13 edges (0), time = 0.393ms.
2020-03-19 10:13:02.671353: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] TensorRTOptimizer: Graph size after: 14 nodes (0), 13 edges (0), time = 0.052ms.
2020-03-19 10:13:02.671357: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 14 nodes (0), 13 edges (0), time = 0.544ms.
2020-03-19 10:13:02.671361: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:716] Optimization results for grappler item: TRTEngineOp_3_native_segment
2020-03-19 10:13:02.671365: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 24 nodes (0), 27 edges (0), time = 0.436ms.
2020-03-19 10:13:02.671368: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] layout: Graph size after: 24 nodes (0), 27 edges (0), time = 0.306ms.
2020-03-19 10:13:02.671372: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 24 nodes (0), 27 edges (0), time = 0.454ms.
2020-03-19 10:13:02.671376: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] TensorRTOptimizer: Graph size after: 24 nodes (0), 27 edges (0), time = 0.043ms.
2020-03-19 10:13:02.671379: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 24 nodes (0), 27 edges (0), time = 0.608ms.
2020-03-19 10:13:02.671383: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:716] Optimization results for grappler item: BoxPredictor_1/ClassPredictor/TRTEngineOp_1_native_segment
2020-03-19 10:13:02.671386: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 6 nodes (0), 5 edges (0), time = 0.261ms.
2020-03-19 10:13:02.671389: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] layout: Graph size after: 6 nodes (0), 5 edges (0), time = 0.148ms.
2020-03-19 10:13:02.671392: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 6 nodes (0), 5 edges (0), time = 0.264ms.
2020-03-19 10:13:02.671395: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] TensorRTOptimizer: Graph size after: 6 nodes (0), 5 edges (0), time = 0.028ms.
2020-03-19 10:13:02.671399: I tensorflow/core/grappler/optimizers/meta_optimizer.cc:718] constant folding: Graph size after: 6 nodes (0), 5 edges (0), time = 0.262ms.
2020-03-19 10:13:08.026309: I tensorflow/compiler/tf2tensorrt/kernels/trt_engine_op.cc:812] Starting calibration thread on device 0, Calibration Resource @ 0x7f402801dce0
2020-03-19 10:13:08.784457: E tensorflow/compiler/tf2tensorrt/utils/trt_logger.cc:41] DefaultLogger …/rtSafe/safeContext.cpp (105) - Cudnn Error in initializeCommonContext: 4 (Could not initialize cudnn, please check cudnn installation.)
2020-03-19 10:13:08.784723: E tensorflow/compiler/tf2tensorrt/utils/trt_logger.cc:41] DefaultLogger …/rtSafe/safeContext.cpp (105) - Cudnn Error in initializeCommonContext: 4 (Could not initialize cudnn, please check cudnn installation.)
2020-03-19 10:13:08.784995: E tensorflow/compiler/tf2tensorrt/kernels/trt_engine_op.cc:838] Calibration failed: Internal: Failed to build TensorRT engine
2020-03-19 10:13:08.785125: W tensorflow/core/common_runtime/base_collective_executor.cc:216] BaseCollectiveExecutor::StartAbort Internal: Failed to feed calibration data
[[{{node TRTEngineOp_0}}]]
[[Postprocessor/BatchMultiClassNonMaxSuppression/map/while/Identity/_76]]
2020-03-19 10:13:08.785267: W tensorflow/core/common_runtime/base_collective_executor.cc:216] BaseCollectiveExecutor::StartAbort Internal: Failed to feed calibration data
[[{{node TRTEngineOp_0}}]]
Traceback (most recent call last):
File “V2ConvertTFTRTInt8.py”, line 63, in
converter.convert(calibration_input_fn=calibration_input_fn)
File “/home/guo/runprogram/Envs/py36tf20/lib/python3.6/site-packages/tensorflow_core/python/compiler/tensorrt/trt_convert.py”, line 984, in convert
self._converted_func(*map(ops.convert_to_tensor, inp))
File “/home/guo/runprogram/Envs/py36tf20/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py”, line 1081, in call
return self._call_impl(args, kwargs)
File “/home/guo/runprogram/Envs/py36tf20/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py”, line 1121, in _call_impl
return self._call_flat(args, self.captured_inputs, cancellation_manager)
File “/home/guo/runprogram/Envs/py36tf20/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py”, line 1224, in _call_flat
ctx, args, cancellation_manager=cancellation_manager)
File “/home/guo/runprogram/Envs/py36tf20/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py”, line 511, in call
ctx=ctx)
File “/home/guo/runprogram/Envs/py36tf20/lib/python3.6/site-packages/tensorflow_core/python/eager/execute.py”, line 67, in quick_execute
six.raise_from(core._status_to_exception(e.code, message), None)
File “”, line 3, in raise_from
tensorflow.python.framework.errors_impl.InternalError: 2 root error(s) found.
(0) Internal: Failed to feed calibration data
[[node TRTEngineOp_0 (defined at /home/guo/runprogram/Envs/py36tf20/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1751) ]]
[[Postprocessor/BatchMultiClassNonMaxSuppression/map/while/Identity/_76]]
(1) Internal: Failed to feed calibration data
[[node TRTEngineOp_0 (defined at /home/guo/runprogram/Envs/py36tf20/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1751) ]]
0 successful operations.
0 derived errors ignored. [Op:__inference_pruned_50623]
Function call stack:
pruned → pruned