- output = rknn.inference(inputs=[input])
- output = np.transpose(output.reshape((batch, channel, height, width)), (0, 2, 3, 1))
复制代码
jefferyzhang 发表于 2019-3-21 09:06
需要reshape的,因为对于硬件存储的数据来说,都只是一维数组指针而已,需要显式转化你所知道的输出形状。 ...
- rknn.load_tensorflow(tf_pb='./models/mobilenet_thin/graph_opt.pb',
- inputs=['image'],
- outputs=['Openpose/concat_stage7'],
- input_size_list=[[224,224, 3]])
复制代码
- input_size_list=[[432,368, 3]]
- input_size_list=[[224,224, 3]]
- input_size_list=[[416,416, 3]]
复制代码
- rknn.config(channel_mean_value='0 0 0 255', reorder_channel='0 1 2', batch_size=1)
复制代码
- # Build model
- print('--> Building model')
- rknn.build(do_quantization=True, dataset='./data.txt',pre_compile=False)
- # rknn.build(do_quantization=False)
- print('done')
复制代码
kitedream 发表于 2019-3-21 09:32
你好,请问 input_size_list 的尺寸,是按照维度顺序输入的吗?我目前在移植网上开源的openpose tensorfl ...
jefferyzhang 发表于 2019-3-21 10:01
input size需要根据模型的第一个输入参数确认,不能随意写的。模型的输入shape是224你这里就只能输入224 ...
- D [rknn_init:749] Input Tensors:
- D [printRKNNTensor:662] index=0 name= n_dims=4 dims=[1 3 368 432] n_elems=476928 size=476928 fmt=NCHW type=UINT8 qnt_type=AFFINE fl=0 zp=0 scale=0.003922
- D [rknn_init:762] Output Tensors:
- D [printRKNNTensor:662] index=0 name= n_dims=4 dims=[1 57 46 54] n_elems=141588 size=141588 fmt=NCHW type=UINT8 qnt_type=AFFINE fl=6 zp=6 scale=0.004017
复制代码
- output=output.reshape(1, 57, 46, 54)
- output = np.transpose(output, (0, 2, 3, 1))
复制代码
欢迎光临 Toybrick (https://t.rock-chips.com/) | Powered by Discuz! X3.3 |