# Converting .pt to .nb

**URL:** <https://forum.amebaiot.com/t/converting-pt-to-nb/3690>\
**Category:** AI\
**Tags:** rtl8735b, evb-amb82\
**Created:** [January 7, 2025, 5:43am UTC](https://forum.amebaiot.com/t/converting-pt-to-nb/3690 "2025-01-07T05:43:31Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Steph\_B](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/steph_b/32/2422_2.png) [@Steph\_B](https://forum.amebaiot.com/u/Steph_B)\
**Post date:** [January 10, 2025, 1:43am UTC](https://forum.amebaiot.com/t/converting-pt-to-nb/3690/3 "2025-01-10T01:43:49Z")

</div>

Thank you for confirming this!

I’m still experiencing some issues uploading the yolov7\_tiny.nb file. Would you be able to check over my process to see if I’m missing anything?:

**Training**  
I made sure to train the model using only yolov7-tiny with a smaller dataset and fewer epochs to try to minimize the file size.  
Doing this allowed me to get a best.pt file that is only about 11MB.

**SDK**  
I downloaded the SDK version 4.0.8 to use on my Arduino IDE 2.3.4.  
(I made sure to get the reparametrizing files reparam\_yolov7-tiny.py and yolov7-tiny-deploy.yaml from here as well)

**Reparameterizing**  
I reparameterized the best.pt file using the following method as mentioned in the Neural Network - Object Detection guide:  
python reparam\_yolov7-tiny.py –weights weights/best.pt –custom\_yaml custom/yolov7-tiny-deploy.yaml –output best\_reparam.pt

**Converting .pt to .nb**  
Then, I used the online converter to get the .nb file which I renamed “yolov7\_tiny.nb”

**Copy/Replace .nb**  
As per the Customized AI model Installation Guide, I added the yolov7\_tiny.nb file to my sketch folder like so:  
C:\Users\USERNAME\AppData\Local\Arduino15\packages\realtek\hardware\AmebaPro2\4.0.8\libraries\NeuralNetwork\examples\ObjectDetectionLoop\yolov7\_tiny.nb

So now I have the following 3 files in the ObjectDetectionLoop folder:  
ObjectClassList.h  
ObjectDetectionLoop  
yolov7\_tiny.nb

**Customizations**  
For the ObjectDetectionLoop file, I added my wifi info and updated this line:  
ObjDet.modelSelect(OBJECT\_DETECTION, CUSTOMIZED\_YOLOV7TINY, NA\_MODEL, NA\_MODEL);

For the ObjectClassList.h file, I changed the number of classes and the names of the classes to match the class information I had in my .yaml files from training.

**Conclusion**  
Despite all of this, I still can’t get the .nb file to properly upload to the AMB82 mini.  
I’ve tried uploading via flash and an SD card where I stored yolov7\_tiny.nb in a folder called NN\_MDL.  
When I try to use flash, I get the following error:  
“Model (.nb file) missing or customized model name mismatch. Please include your customized model in sketch folder or rename your model if it is already in sketch folder.”

When I try to use the SD card method, I can’t tell if the model even uploaded since no bounding boxes show up.  
I know the model should work since I tested it with example images on my Colab notebook.

I’m not sure what I’m doing wrong to cause the .nb file not to upload. Would you be able to give me any other troubleshooting advice?  
Please let me know if you need any additional info or would like to check any files.

---

_[View the full topic](https://forum.amebaiot.com/t/converting-pt-to-nb/3690)._
