Can anyone recommend a Tflite Colab Notebook for VOXL2 Training
-
@sansoy Can you try adding your user to the dialout group and seeing if that fixes the issue?
sudo usermod -a -G dialout $USER
-
@tom did that and still no inference.
-
@sansoy That was for fixing the fastboot issue, unrelated
-
When I get some time today I'll try to download your .tflite models and see what's going on. The good news is that the server is at least running! It very well may just be an issue with how the tensor is being parsed.
Thomas
thomas.patton@modalai.com -
Hey, they just gave me access to the Google Drive folder. Can you confirm that the
edgetpu.tflite
in the root directory is the file you want me to try and get working?Thomas
-
@thomas i just checked permissions and you have access to all the files and yes to
edgetpu.tflit
ssd-mobilenet-v2-fpnlite-640_quant.tflite
ssd-mobilenet-v2-fpnlite-640.tflite
saved_models/saved_model.pb -
Of these 4 models which is the custom trained YOLO model you mentioned above? I can't even get the
edgetpu.tflite
model to load so I need a little bit more information on how each of these files was generated.Thomas
-
@thomas here's a yolov5 trained model.
https://drive.google.com/file/d/1wRbIXdylgx-EOGDLnuWnsytGd2DcTNeY/view?usp=drive_linkI used this instruction set to train a yolov5 model which works well on my mac, rPI4, linux box and nvidia jetson.
https://docs.ultralytics.com/yolov5/tutorials/train_custom_data/#23-organize-directories -
@thomas here's the colab notebook i used to create the tflites and quantized tflites
https://colab.research.google.com/drive/1QdgpSl63OSQdLTnFwOyP8dxLQ7W0HtmW?usp=sharing -
I found the bug in our code that's causing the issue. You can see on this line that a for YOLO models a former employee hardcoded the number of classes to be 80 leading to a segfault when we only have a single class like in your case. Here's what your model looks like on our server with the fix:
What I'm going to do is write a patch for
voxl-tflite-server
that more intelligently reads the number from the labels file. This will be available in our SDK Nightlies and so you'll be able to use the fix tomorrow morning. If you'd like the fix sooner, what I can do is package the new voxl-tflite-server into a .deb so you can deploy it manually to your VOXL. I can help you out with this process if you're not familiar.Thanks,
Thomas Patton
thomas.patton@modalai.com -
@thomas
https://gitlab.com/voxl-public/voxl-sdk/services/voxl-tflite-server/-/merge_requests/22
Here's the merge request with the fix, this will be published both in tonight's nightly and new SDK releases.
Thomas
-
@thomas you rock! awesome! thanks for troubleshooting.
-
@thomas thanks thomas. will download tomorrow and test either in evening or next day. Really appreciate your help with this.
Great job! Sabri -
Yeah of course, glad I could be of assistance! Be sure to let me know if you need any more help with this.
Two things I was thinking about on my drive home that you should know - First, when you're on that page I linked above for the software nightlies make sure you sort the files by date descending so that you get the most recent one. I always make the mistake of getting the wrong one. Secondly, when you flash that nightly SDK it will overwrite anything not in the
/data/
directory and so you will need to put your model file and labels txt back into/usr/bin/dnn/
.Thomas
-
@thomas Morning Thomas, just getting back to this. I couldnt find any SDK that had a 2024 stamp. Was this uploaded somewhere else?
Sabri -
Here's the one from last night:
https://console.cloud.google.com/storage/browser/_details/platform-nightlies/voxl2/voxl2_SDK_nightly_20240117.tar.gz?pageState=("StorageObjectListTable":("s":[("i":"objectListDisplayFields%2FtimeLastModified","s":"1"),("i":"displayName","s":"0")%5D))&organizationId=517175400245&project=modalai-core-services
You just have to make sure when you're on this page that you sort date modified by descending.
Thanks,
Thomas -
@thomas
installed voxl2_SDK_nightly_20240117.tar.gz
per https://docs.modalai.com/flash-system-image/still not getting any detection even with your default yolov5. ive tried with hires large color, small color and grey.
-
-
@thomas @sansoy
So I was able to get our YOLO model running immediately, am about to try yours next. All I did was:
- Flash the nightly SDK from last night using the steps you linked above
- Edited
/etc/modalai/voxl-tflite-server.conf
so that the model was/usr/bin/dnn/yolov5_float16_quant.tflite
and the input pipe was/run/mpa/hires_small_color
.
You should definitely try to reproduce this result as if you can't it might indicate a deeper problem.
Then to use your custom model:
adb shell
and thencd /usr/bin/dnn
and thencp yolov5_labels.txt yolov5_labels.txt.bak && cp yolov5_float16_quant.tflite yolov5_float16_quant.tflite.bak
to back up the existing model and label files.vi yolov5_labels.txt
and change to only havear15
as a class- From outside ADB,
adb push yolo5_fp16_quant.tflite /usr/bin/dnn/yolov5_float16_quant.tflite
voxl-tflite-server
Thomas
thomas.patton@modalai.com -
@thomas WORKED! i did most of what you stated except for renaming my file to your filename. !
in a future release would be able to use the original filename vs renaming it to something that is hardcoded?