Open iot-hunter opened 4 years ago
edit your anchors like this https://github.com/hunglc007/tensorflow-yolov4-tflite/issues/111#issuecomment-650205659
@hunglc007 Do you means delete 10 from Anchors array ?
You edit anchors into [23,27, 37,58, 81,82, 81,82, 135,169, 344,319]
@hunglc007 mask change to new int[][]{{3, 4, 5}, {0, 1, 2}} ?
Hi, it seems you guys are able to run the app without force closed. I had a problem in running the app, since it always force closed when starting the detection process (I guess). I got the following error from logcat in Android Studio
java.lang.IllegalArgumentException: Cannot copy between a TensorFlowLite tensor with shape [1, 2535, 4] and a Java object with shape [1, 26, 26, 3, 96].
Any thought is very appreciated. Cheers,
Hi @hattafudholi I am seeing the same error when trying to run yolov4 tiny model in android app. Have you been able to resolve this error yet? Any help is greatly appreciated.
When running larger (i.e., not tiny one) yolov4 model, I get the following error (as seen in logcat in Android Studio):
java.lang.IllegalArgumentException: Cannot copy from a TensorFlowLite tensor (Identity) with shape [1, 10647, 4] to a Java object with shape [1, 52, 52, 3, 85].
Any help or insight to resolve this error is greatly appreciated. Thanks.
Hi @hattafudholi I am seeing the same error when trying to run yolov4 tiny model in android app. Have you been able to resolve this error yet? Any help is greatly appreciated.
no, not yet.
Hi @hattafudholi I am seeing the same error when trying to run yolov4 tiny model in android app. Have you been able to resolve this error yet? Any help is greatly appreciated.
no, not yet.
oh ok. Thanks for the update. Not sure why its coming, could it be due to incorrect use of masks and anchors in the code?
Hi @hattafudholi I am seeing the same error when trying to run yolov4 tiny model in android app. Have you been able to resolve this error yet? Any help is greatly appreciated.
no, not yet.
But for yolov4 tiny, i did change masks and anchors as described by @hunglc007 in one of the comments above. But I still see the above error. Sigh!
@hunglc007 I am facing the same error while trying to run a yolov4.tflite, Please resolve
java.lang.IllegalArgumentException: Cannot copy between a TensorFlowLite tensor with shape [1, 2535, 4] and a Java object with shape [1, 52, 52, 3, 85].
same error any one can help ?
Cannot copy between a TensorFlowLite tensor with shape [1, 10647, 4] and a Java object with shape [1, 52, 52, 3, 85]
I think I might just fix this problem by re-implementing the recongizeImage method in YoloV4Classifier class. This problem has nothing to do with anchor boxes or masks used, since the yolov4-tiny handle output bounding boxes is a little different from regular version. It just the output tensor's dimension and desired tensor's dimension cannot be matched. Therefore, we would see the error like this
java.lang.IllegalArgumentException: Cannot copy between a TensorFlowLite tensor with shape [1, 2535, 4] and a Java object with shape [1, 52, 52, 3, 85]
Hope it can be a little help for you.
I think I might just fix this problem by re-implementing the recongizeImage method in YoloV4Classifier class. This problem has nothing to do with anchor boxes or masks used, since the yolov4-tiny handle output bounding boxes is a little different from regular version. It just the output tensor's dimension and desired tensor's dimension cannot be matched. Therefore, we would see the error like this
java.lang.IllegalArgumentException: Cannot copy between a TensorFlowLite tensor with shape [1, 2535, 4] and a Java object with shape [1, 52, 52, 3, 85]
Hope it can be a little help for you.
Hi, thanks for your excellent work @WinstonHuTiger . I came to your github and tried your version of android repo. It works well with your supplied model (yolov4-416-fp32.tflite). However, when I tried to change the model with other yolov4-tiny model (which I exported using convert_tflite.py from your repo and the public coco yolov4-tiny.weight), I always got the following error:
java.lang.IllegalArgumentException: Cannot copy between a TensorFlowLite tensor with shape [1, 2535, 80] and a Java object with shape [1, 2535, 4]
Do you have any clue? Cheers,
I have Change ANCHORS MASKS OUTPUT_WIDTH to this:
but the predect Box is smaller or bigger than ground truth