PPTSM转onnx模型时,temporal_shift算子不支持。
请问paddle官方有替代的算子吗?
另外我自己参考github上其他人的操作,修改一个op,麻烦帮忙看看这种方式对不对,我想用到移动端效率可以吗? def shift_paddle(x, seg_num, shift_ratio): nt, c, h, w = x.size() shape = x.shape # [N*T, C, H, W] reshape_x = x.reshape((-1, seg_num, shape[1], shape[2], shape[3])) #[N, T, C, H, W] c1 = int(shape[1] * shift_ratio) c2 = int(shape[1] * 2 * shift_ratio) n_batch = reshape_x.shape[0]
left_side = paddle.concat((reshape_x[:, 1:, :c1], paddle.zeros(n_batch, 1, c1, h, w)), dim=1)
middle_side = paddle.concat((paddle.zeros(n_batch, 1, c2-c1, h, w), reshape_x[:, :n_segment - 1, c1: c2]), dim=1)
out = paddle.concat((left_side, middle_side, reshape_x[:, :, c2:]), dim=2)
return out.reshape(nt, c, h, w)
组合op的实现方式可以参考这个
https://github.com/PaddlePaddle/PaddleVideo/blob/develop/docs/zh-CN/tutorials/accelerate.md#op融合 ,但显存占用比较大,可以尝试使用inplace操作
组合op的实现方式可以参考这个
https://github.com/PaddlePaddle/PaddleVideo/blob/develop/docs/zh-CN/tutorials/accelerate.md#op融合 ,但显存占用比较大,可以尝试使用inplace操作
您好,请问现在支持PPTSM转onnx了吗,然后有没有相关onnx 的c++推理例程可以参考?谢谢!
@huangjun12 @chen1234520 @cloud-zZ 您好,现在ppTSMv2 和ppTSM模型转换的过程是怎么样的,我这边有些问题
paddle2onnx --model_dir inference/PPTSMv2 --model_filename ppTSMv2.pdmodel --params_filename ppTSMv2.pdiparams --save_file ppTSMv2.onnx --enable_dev_version True [Paddle2ONNX] Start to parse PaddlePaddle model... [Paddle2ONNX] Model file path: inference/PPTSMv2\ppTSMv2.pdmodel [Paddle2ONNX] Paramters file path: inference/PPTSMv2\ppTSMv2.pdiparams [Paddle2ONNX] Start to parsing Paddle model... [Paddle2ONNX] Oops, there are some operators not supported yet, including temporal_shift, [ERROR] Due to the unsupported operators, the conversion is aborted.
麻烦交流一下
您好,请问问题还是否需要解决,目前多模态视频能力集成在PaddleMIX中,https://github.com/PaddlePaddle/PaddleMIX/tree/develop 可以在这个repo下提出您的需求