PaddlePaddle / Paddle.js

Paddle.js is a web project for Baidu PaddlePaddle, which is an open source deep learning framework running in the browser. Paddle.js can either load a pre-trained model, or transforming a model from paddle-hub with model transforming tools provided by Paddle.js. It could run in every browser with WebGL/WebGPU/WebAssembly supported. It could also run in Baidu Smartprogram and WX miniprogram.
https://paddlejs.baidu.com
Apache License 2.0
998 stars 139 forks source link

continuous performance degradation when running tiny_pose #262

Open luan007 opened 2 years ago

luan007 commented 2 years ago

Hi again,

I've successfully converted pp tiny_pose (256 & 128 versions) to paddle.js env, & all works out smoothly.

However, after a while (10~20s) the predict function becomes slower & slower, from (initially) 50ms to 200ms & so on.

To reproduce the effect please check out: (replace mobilenet example folder with this & do webpack.)

(http-server -o and go to 127.0.0.1:8080, as this requests your camera & needs to run on localhost to avoid https policy)

tiny_pose.zip

The program is running in chrome, with a 2019 macbook pro with dGPU, paddle.js webgl backend.

Although in the end, this issue may closely tied to the converted model, I still think it would be helpful for the community to provide some insights on how to deal with this during model adaptation process.

Thanks!

JingyuanZhang commented 2 years ago

ok~ we'll follow the issue.

luan007 commented 2 years ago

Thanks!

JingyuanZhang commented 2 years ago

试一下 最新版本 看一下 https://github.com/PaddlePaddle/Paddle.js/pull/396 https://github.com/PaddlePaddle/Paddle.js/pull/398

@paddlejs/paddlejs-backend-webgl@1.1.19 @paddlejs/paddlejs-core@2.1.17

justplus commented 2 years ago

@luan007 你转换的这个avg RT=120ms... 我转换的压根没法跑起来,转换后的模型如附件model.zip

模型转换使用的是paddlejsconverter https://bj.bcebos.com/v1/paddledet/models/keypoint/tinypose_enhance/tinypose_128x96.zip 但是运行后返回值如下:[ { "conv2d_441.tmp_1": [ ..., 11.171875 ] }, { "argmax_0.tmp_0": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] } ]

@JingyuanZhang 帮忙分析下呗。