# The use of weight file (.pt)

**URL:** <https://community.ultralytics.com/t/the-use-of-weight-file-pt/462>\
**Category:** Discussion\
**Tags:** question\
**Created:** [November 2, 2024, 6:45pm UTC](https://community.ultralytics.com/t/the-use-of-weight-file-pt/462 "2024-11-02T18:45:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chen\_Lu](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/chen_lu/32/383_2.png) [@chen\_Lu](https://community.ultralytics.com/u/chen_Lu)\
**Post date:** [November 2, 2024, 6:45pm UTC](https://community.ultralytics.com/t/the-use-of-weight-file-pt/462/1 "2024-11-02T18:45:18Z")

</div>

When I was validating the model, I found that only .pt files were used without any other way to obtain the model structure. If I want to use the weights from the .pt file in another structure that I have recorded in a yaml file, which has a different structure from the .pt file but uses the same weights, is there any way to achieve this?

---

<div class="post-metadata">

**Author:** ![Toxite](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/toxite/32/123_2.png) [@Toxite](https://community.ultralytics.com/u/Toxite)\
**Post date:** [November 2, 2024, 10:18pm UTC](https://community.ultralytics.com/t/the-use-of-weight-file-pt/462/2 "2024-11-02T22:18:56Z")

</div>

You can load weights from a `.pt` file using `.load()`.

```python
from ultralytics import YOLO

model = YOLO("yolo11n.yaml").load("yolo11n.pt")

```
