Closed xavier-xiadia closed 3 years ago
你好,非常感谢您所做的工作,在过程中遇到了一些问题,请教: 运行keras_onnx.py环境: tensorflow-gpu==1.13.1 keras==2.1.5 遇到问题 Traceback (most recent call last): File "keras_onnx.py", line 319, in rnet_onnx_model = keras2onnx.convert_keras(rnet, rnet.name) File "/usr/local/lib/python3.6/dist-packages/keras2onnx/main.py", line 95, in convert_keras return convert_topology(topology, name, doc_string, target_opset, channel_first_inputs) File "/usr/local/lib/python3.6/dist-packages/keras2onnx/topology.py", line 243, in convert_topology get_converter(operator.type)(scope, operator, container) File "/usr/local/lib/python3.6/dist-packages/keras2onnx/ke2onnx/main.py", line 96, in convert_keras_flatten if iop.data_format == 'channels_last' or shape_len < 3: AttributeError: 'Flatten' object has no attribute 'data_format' keras.layers.core.Flatten里面没有data_format,我就直接把判断是不是channels_last默认为channels_last,想先跑通
然后在onnx2engine中: 环境 tensorrt7 cuda 11 trtexec --explicitBatch --workspace=512 --onnx=pnet.onnx --minShapes=input_1:1x12x12x3 --optShapes=input_1:4x400x400x3 --maxShapes=input_1:8x1280x1280x3 --shapes=input_1:8x400x400x3 --saveEngine=pnet.engine 出现: 02/25/2021-07:12:18] [E] [TRT] conv1: image size is smaller than filter size
由于pnet里面没有flatten的问题,所以初步推测这个问题应该跟我改flatten无关,但是不知道作者是否遇到过这个问题,还望指教
你好,非常感谢您所做的工作,在过程中遇到了一些问题,请教: 运行keras_onnx.py环境: tensorflow-gpu==1.13.1 keras==2.1.5 遇到问题 Traceback (most recent call last): File "keras_onnx.py", line 319, in
rnet_onnx_model = keras2onnx.convert_keras(rnet, rnet.name)
File "/usr/local/lib/python3.6/dist-packages/keras2onnx/main.py", line 95, in convert_keras
return convert_topology(topology, name, doc_string, target_opset, channel_first_inputs)
File "/usr/local/lib/python3.6/dist-packages/keras2onnx/topology.py", line 243, in convert_topology
get_converter(operator.type)(scope, operator, container)
File "/usr/local/lib/python3.6/dist-packages/keras2onnx/ke2onnx/main.py", line 96, in convert_keras_flatten
if iop.data_format == 'channels_last' or shape_len < 3:
AttributeError: 'Flatten' object has no attribute 'data_format'
keras.layers.core.Flatten里面没有data_format,我就直接把判断是不是channels_last默认为channels_last,想先跑通
然后在onnx2engine中: 环境 tensorrt7 cuda 11 trtexec --explicitBatch --workspace=512 --onnx=pnet.onnx --minShapes=input_1:1x12x12x3 --optShapes=input_1:4x400x400x3 --maxShapes=input_1:8x1280x1280x3 --shapes=input_1:8x400x400x3 --saveEngine=pnet.engine 出现: 02/25/2021-07:12:18] [E] [TRT] conv1: image size is smaller than filter size
由于pnet里面没有flatten的问题,所以初步推测这个问题应该跟我改flatten无关,但是不知道作者是否遇到过这个问题,还望指教