# Exporting model

**URL:** <https://discuss.roboflow.com/t/exporting-model/315>\
**Category:** 🤝  Community Help\
**Created:** [April 11, 2022, 12:10pm UTC](https://discuss.roboflow.com/t/exporting-model/315 "2022-04-11T12:10:41Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luis\_Monge](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/luis_monge/32/194_2.png) [@Luis\_Monge](https://discuss.roboflow.com/u/Luis_Monge)\
**Post date:** [April 11, 2022, 12:10pm UTC](https://discuss.roboflow.com/t/exporting-model/315/1 "2022-04-11T12:10:41Z")

</div>

Hi,

I was wondering if I can train a model on Roboflow and then be able to export or retrieve the model file. In this case, having trained a model with Yolov5 I wanted the .pt or .pth file. Is it possible?

---

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [April 11, 2022, 3:26pm UTC](https://discuss.roboflow.com/t/exporting-model/315/2 "2022-04-11T15:26:18Z")

</div>

> ℹ **Update (September 2026):** Model weights download is now available on every plan, including the Free Tier, through the [Roboflow Inference](https://inference.roboflow.com) package or the Python SDK. See [Download Roboflow Model Weights](https://docs.roboflow.com/models/model-weights/download-roboflow-model-weights). Self-hosting with Roboflow Inference is also free and doesn’t consume credits. Commercial self-hosting of some models (for example Ultralytics YOLO and RF-DETR 2XL) needs an Enterprise license add-on, see [roboflow.com/licensing](https://roboflow.com/licensing).

* * *

~~Update as of February 2025: our new Basic and Growth plans now include model weights download.~~ Docs: [Download Model Weights | Models | Roboflow Docs](https://docs.roboflow.com/deploy/download-roboflow-model-weights)

* * *

> **Old Answer**
>
> Hi Luis,
> 
> Unfortunately, we do not release the weights files from Roboflow Train by default, but any custom model trained with our Model Zoo ([models.roboflow.com](http://models.roboflow.com)) results in final weights files for export.
> 
> To train a custom YOLOv5 model: [Video](https://www.loom.com/share/38e684f906f5495a96c50a4dabf0b119)
> 
> To save the weights: [How to Save and Load Model Weights in Google Colab](https://blog.roboflow.com/how-to-save-and-load-weights-in-google-colab/)

---

<div class="post-metadata">

**Author:** ![Hudson\_Kim](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/hudson_kim/32/803_2.png) [@Hudson\_Kim](https://discuss.roboflow.com/u/Hudson_Kim)\
**Post date:** [October 10, 2022, 7:33am UTC](https://discuss.roboflow.com/t/exporting-model/315/3 "2022-10-10T07:33:18Z")

</div>

Do you have any plans to do so in the future? It would be really nice to have a completely no code solution instead of having to go outside of Roboflow and use a Google Colab notebook. I would like if we could export it as a tflite model.

---

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [October 21, 2022, 6:19pm UTC](https://discuss.roboflow.com/t/exporting-model/315/4 "2022-10-21T18:19:13Z")

</div>

We do have local deployment options: [Launch: Test Computer Vision Models Locally](https://blog.roboflow.com/locally-deploy-computer-vision/) and [Inference - Object Detection - Roboflow](https://docs.roboflow.com/inference) (any option that reads “On-Device”).

For Raspberry Pi deployment for example: [Raspberry Pi (On Device) - Roboflow](https://docs.roboflow.com/inference/raspberry-pi)

We do take the feature request feedback. Implementation depends on the number of people requesting and also our development team’s timeline.

---

<div class="post-metadata">

**Author:** ![staebchen0](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/staebchen0/32/1017_2.png) [@staebchen0](https://discuss.roboflow.com/u/staebchen0)\
**Post date:** [January 13, 2023, 5:21pm UTC](https://discuss.roboflow.com/t/exporting-model/315/5 "2023-01-13T17:21:13Z")

</div>

> [@Hudson\_Kim](#):
>
> Google Colab-Notebook

Being able to create a tflite model would be great!  
So far I have not managed to create a tflite mode in Colab based on the Roboflow data with the instructions I have found.

The examples I found in Robflow are based on an old TF version and don’t work properly anymore

---

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [January 13, 2023, 5:44pm UTC](https://discuss.roboflow.com/t/exporting-model/315/6 "2023-01-13T17:44:21Z")

</div>

Hi, we’re working on an updated Colab notebook that works with Tensor Flow 2 for export to TFLite.

- [Work In Progress - TF2, TFLite Export Colab Notebook](https://colab.research.google.com/drive/1LHBb5AQ-osCq6vNs4-VDR-9lbq2XsdhZ?usp=sharing)

I haven’t yet fully tested it myself, but it worked with the sample data provided from Google’s original notebook.

Once we get it tested, we’ll be updating the notebook to make the flow easier to follow, and including it in the [Notebooks repository](https://github.com/roboflow/notebooks) on GitHub.

---

<div class="post-metadata">

**Author:** ![staebchen0](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/staebchen0/32/1017_2.png) [@staebchen0](https://discuss.roboflow.com/u/staebchen0)\
**Post date:** [January 14, 2023, 9:19am UTC](https://discuss.roboflow.com/t/exporting-model/315/7 "2023-01-14T09:19:49Z")

</div>

Thank you 🙂 I will try it

---

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [January 23, 2023, 7:13pm UTC](https://discuss.roboflow.com/t/exporting-model/315/8 "2023-01-23T19:13:41Z")

</div>

Here’s an updated TFLite notebook: [Google Colab](https://colab.research.google.com/drive/1jBIwgmRWpUlZB1vi5lgTnrVLeaR9IKf0?usp=sharing)

The model architecture used in training is: EfficientDet

I fully tested it with a project of my own.

---

<div class="post-metadata">

**Author:** ![staebchen0](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/staebchen0/32/1017_2.png) [@staebchen0](https://discuss.roboflow.com/u/staebchen0)\
**Post date:** [January 24, 2023, 5:09pm UTC](https://discuss.roboflow.com/t/exporting-model/315/9 "2023-01-24T17:09:28Z")

</div>

Hi, thank you for the great support 🙂

I’m just trying it out. I still have one question:

The image size of my images is 224_224  
The input size for EfficientDet-Lite1 is 640x640, do I have to adjust the image size first, or can I work with 224_224?

So far I’ve created the models with Teachable Machine, which requires an image size of 224\*224 for a tflite model

---

<div class="post-metadata">

**Author:** ![staebchen0](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/staebchen0/32/1017_2.png) [@staebchen0](https://discuss.roboflow.com/u/staebchen0)\
**Post date:** [January 24, 2023, 5:29pm UTC](https://discuss.roboflow.com/t/exporting-model/315/10 "2023-01-24T17:29:20Z")

</div>

The following error occurs when exporting

 ![error-Export Model](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/0/06ff64c54ce107e02a2b8fc66b5a764524b37ec8.png)

I use tensorflow version 2.8.4

```auto
tflite_filename = 'model_Cookie.tflite'

label_filename = 'labels.txt'

vocab_filename = 'vocab.txt'

saved_model_filename = 'saved_model'

tfjs_folder_name = 'tfjs'

## available formats: tflite, tfjs, saved_model, vocab, label

#export_format = ['tflite', 'tfjs', 'saved_model'] #export in TFLite, TFJs, TF Saved Model

export_format = ['tflite']

```

I didn’t specify any special characters either

---

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [January 25, 2023, 5:29pm UTC](https://discuss.roboflow.com/t/exporting-model/315/11 "2023-01-25T17:29:23Z")

</div>

It would be best to use a size most-comparable to the input size of the model architecture you’re training with. Generating a new version at 640x640 is an option in Roboflow, too.

I’m not sure what underlying model Teachable Machine uses. Whatever architecture they use is what is influencing those resize parameters.

---

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [January 25, 2023, 5:35pm UTC](https://discuss.roboflow.com/t/exporting-model/315/12 "2023-01-25T17:35:56Z")

</div>

I was able to fully run the notebook and get the export without issue:

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/1/1217457e0cd6ef676fadd13bab74234773b07f5e.png)

Maybe its the `_Cookie` you’ve included in your `tflite_filename`? I also ran this notebook with Tensorflow 2.8.4 - I created the notebook while I ran through the full process last week.

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/7/7e8dde8b01ad226e8f737ae4e1bd7990caff3f07.png)

And I do also want to add that you can change the EfficientDet model you use - I just happened to choose `1` in this case.

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/a/aef4c1a06e0ce2d630df8ca7bdd529cc00597122.png)

---

<div class="post-metadata">

**Author:** ![staebchen0](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/staebchen0/32/1017_2.png) [@staebchen0](https://discuss.roboflow.com/u/staebchen0)\
**Post date:** [January 25, 2023, 7:28pm UTC](https://discuss.roboflow.com/t/exporting-model/315/13 "2023-01-25T19:28:35Z")

</div>

strange!  
I modified the code as follows, then at least the tflite file is created.

> model.export(export\_dir=‘.’,tflite\_filename=tflite\_filename,  
> label\_filename=label\_filename, saved\_model\_filename=saved\_model\_filename, tfjs\_folder\_name=tfjs\_folder\_name)

as soon as I add

> export\_format=export\_format)

, the error comes.  
The labels.txt is not generated.  
i tried with

> model.export(export\_dir=‘.’, with\_metadata=False)

---

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [January 25, 2023, 9:26pm UTC](https://discuss.roboflow.com/t/exporting-model/315/14 "2023-01-25T21:26:34Z")

</div>

@staebchen0 I just pulled up the notebook to test it out again.

Maybe something changed with Colab’s pre-installed libraries. I’ll report back with the results and whether I changed anything in the notebook.

---

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [January 25, 2023, 9:36pm UTC](https://discuss.roboflow.com/t/exporting-model/315/15 "2023-01-25T21:36:50Z")

</div>

Just found that Teachable Machine is using MobileNet to train image models. They’re using MobileNet to train a classification model on your images, and resizing to 224x224 for optimal training and inference speed.

Some other notes I wanted to add –

- We actually have a MobileNet Classification notebook and training guide available: [How to Train MobileNetV2 On a Custom Dataset](https://blog.roboflow.com/how-to-train-mobilenetv2-on-a-custom-dataset/)
- Another resource I found - Original Google source for TFLite deployment to Raspberry Pi: [examples/lite/examples/image\_classification/raspberry\_pi at master · tensorflow/examples · GitHub](https://github.com/tensorflow/examples/tree/master/lite/examples/image_classification/raspberry_pi)
- [tflite\_model\_maker.image\_classifier.MobileNetV2Spec &nbsp;|&nbsp; TensorFlow Lite](https://www.tensorflow.org/lite/api_docs/python/tflite_model_maker/image_classifier/MobileNetV2Spec)

---

<div class="post-metadata">

**Author:** ![staebchen0](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/staebchen0/32/1017_2.png) [@staebchen0](https://discuss.roboflow.com/u/staebchen0)\
**Post date:** [February 4, 2023, 2:35pm UTC](https://discuss.roboflow.com/t/exporting-model/315/16 "2023-02-04T14:35:41Z")

</div>

Hi,  
The description says that the data should be downloaded as a folder structure.

In the roboflow export there is no entry with the name “Folder Structure”

Description: [How to Train MobileNetV2 On a Custom Dataset](https://blog.roboflow.com/how-to-train-mobilenetv2-on-a-custom-dataset/)  
“Then simply generate a new version of the dataset and export with a “Folder Structure”. You will recieve a Jupyter notebook command that looks something like this:”

---

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [February 23, 2023, 4:50am UTC](https://discuss.roboflow.com/t/exporting-model/315/17 "2023-02-23T04:50:28Z")

</div>

To receive the export type of “Folder Structure,” you’ll need to be working out of a classification project.

Are you working out of a single label classification project?

---

<div class="post-metadata">

**Author:** ![brad](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/brad/32/23_2.png) [@brad](https://discuss.roboflow.com/u/brad)\
**Post date:** [February 5, 2025, 6:45pm UTC](https://discuss.roboflow.com/t/exporting-model/315/18 "2025-02-05T18:45:06Z")

</div>

> ℹ **Update (September 2026):** Model weights download is now available on every plan, including the Free Tier. See the update above for details.

* * *

~~Update as of February 2025: our new Basic and Growth plans now include model weights download.~~ Docs: [Download Model Weights | Models | Roboflow Docs](https://docs.roboflow.com/deploy/download-roboflow-model-weights)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/1X/bb6edbfa56d0cf2ee603f061e9e09103502cc8cc.png) [@system](https://discuss.roboflow.com/u/system)\
**Post date:** [February 12, 2025, 6:45pm UTC](https://discuss.roboflow.com/t/exporting-model/315/19 "2025-02-12T18:45:42Z")

</div>

Closed on February 12, 2025, 6:45pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
