pytorch / android-demo-app

PyTorch android examples of usage in applications
1.45k stars 596 forks source link

When I click the detect button, the app crashes abnormally (I am using the model I trained myself, not the yolov5 model ) #237

Open zjnlxk opened 2 years ago

zjnlxk commented 2 years ago
捕获
bebbieyin commented 2 years ago

You need to convert the output to Tensor

final Tensor outputTensor = mModule.forward(IValue.from(mInputTensor)).toTensor();

Shahrullo commented 2 years ago

I am also facing the same issue. @bebbieyin it's already converted to Tensor

Shahrullo commented 2 years ago

After all, I solved the problem. The error kept showing up even after converting the output to Tensor. By upgrading my gradle to higher version, the model started working well. @zjnlxk to to update your gradle version