Although I create a .engine , the terminal shows like these:
[TensorRT] WARNING: No implementation of layer up_sampling2d_1/ResizeNearestNeighbor obeys the requested constraints in strict mode. No conforming implementation was found i.e. requested layer computation precision and output precision types are ignored, using the fastest implementation.
[TensorRT] WARNING: No implementation of layer up_sampling2d_2/ResizeNearestNeighbor obeys the requested constraints in strict mode. No conforming implementation was found i.e. requested layer computation precision and output precision types are ignored, using the fastest implementation.
[TensorRT] WARNING: No implementation of layer up_sampling2d_3/ResizeNearestNeighbor obeys the requested constraints in strict mode. No conforming implementation was found i.e. requested layer computation precision and output precision types are ignored, using the fastest implementation.
[TensorRT] WARNING: No implementation obeys reformatting-free rules, at least 2 reformatting nodes are needed, now picking the fastest path instead.
My network has 3 upsampling layers and use the ResizeNearest_TRT instead of the op of ResizeNearest.
Does that mean that I can not use fp16 in the ResizeNearest_TRT?
I think warning is just to inform that dtype of all other tensors will be updated at build time.
To controlled it at output layer, you can use ILayer::setOutputType.
Thank you very much! Could you share how to convert from keras model to onnx model?
I follow the repo:
https://github.com/onnx/keras-onnx
and meet a problem :
node lambda_1/ArgMax of type ArgMax cannot be converted, fall back to tf2onnx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/zhu/keras-onnx-1.6.5/keras2onnx/main.py", line 60, in convert_keras
parse_graph(topology, tf_graph, target_opset, output_names, output_dict)
File "/home/zhu/keras-onnx-1.6.5/keras2onnx/parser.py", line 794, in parse_graph
graph, keras_node_dict, topo, top_level, output_names)
File "/home/zhu/keras-onnx-1.6.5/keras2onnx/parser.py", line 595, in _parse_graph_core
_on_parsing_tf_subgraph(graph, nodes, varset)
File "/home/zhu/keras-onnx-1.6.5/keras2onnx/parser.py", line 335, in _on_parsing_tf_subgraph
raise RuntimeError("Some tensorflow operation doesn't support, stop converting.")
RuntimeError: Some tensorflow operation doesn't support, stop converting.
Hi, I try converting my keras model to a .pb file. Then I try follow the repo:
https://github.com/onnx/tensorflow-onnx
and get a model.onnx successfully.
Then I continue to get a engine as follow:
import tensorrt as trt
model_file = '/home/nvidia/procedure/keras/output/model.onnx'
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
trt.init_libnvinfer_plugins(TRT_LOGGER, '')
EXPLICIT_BATCH = 1 << (int)(trt.NetworkDefinitionCreationFlag.EXPLICIT_BATCH)
builder = trt.Builder(TRT_LOGGER)
network = builder.create_network(EXPLICIT_BATCH)
parser = trt.OnnxParser(network, TRT_LOGGER)
builder.max_workspace_size = 1 << 20
builder.max_batch_size = 1
print('start to parse')
with open(model_file, 'rb') as model:
parser.parse(model.read())
network.mark_output(network.get_layer(network.num_layers-1).get_output(0))
engine = builder.build_cuda_engine(network)
and get the warning:
[TensorRT] WARNING: onnx2trt_utils.cpp:217: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
False
[TensorRT] ERROR: Network has dynamic or shape inputs, but no optimization profile has been defined.
It looks like that my lambda layer is wrong which is