airockchip / rknn-toolkit2

Other
952 stars 101 forks source link

Mobilesam model experiences a large number of operator overflows during inference on the RK3588, which is completely different from the behavior observed in the simulator. #212

Open MiningIrving opened 3 hours ago

MiningIrving commented 3 hours ago

The official provided an example for mobilesam, but I noticed that its img_size is 448, while the original mobilesam model has an image size of 1024. The iou of the provided example is only 0.137, while the original model has an iou of 0.49. I want to use the original model for inference, but after converting the encoder, I found that the output is completely incorrect. After analyzing the board using adb, I discovered that several operators overflowed, which caused the final output to be abnormal. image image

How should I resolve these overflows? After reducing the matrix size, I found that some operators were converted to exSDPAttention, which prevents overflows. I'm not sure why this happens. Could you tell me under what conditions the conversion occurs, or if I can solve the overflow issue by manipulating the operators?

yuyun2000 commented 3 hours ago

it is very hard You can read the documentation to check the limitations of the operator