# Explain pytorch\_model.bin

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fexplain-pytorch-model-bin%2F20744%3E%5C
**Category:** Beginners\
**Created:** [July 22, 2022, 11:28pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fexplain-pytorch-model-bin%2F20744 "2022-07-22T23:28:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CCole](https://avatars.discourse-cdn.com/v4/letter/c/97f17d/32.png) [@CCole](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FCCole)%5C
**Post date:** [July 22, 2022, 11:28pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fexplain-pytorch-model-bin%2F20744%2F1 "2022-07-22T23:28:43Z")

</div>

Hi, can someone explain the pytorch\_model.bin file generated during the training process AND provide a link to the source code that writes it?  
A print statement during training indicates that pytorch\_model.bin is where my weights are saved. When I run: model.num\_parameters(only\_trainable=True), this gives me a number very different from the number of weights that are saved in pytorch\_model.bin (which I am viewing as a pandas dataframe following the steps here: [How To Read Binary File In Python - Detailed Guide - Stack Vidhya](https://www.stackvidhya.com/python-read-binary-file/)). Can someone clarify why these two numbers are different? Thanks!

---

<div class="post-metadata">

**Author:** ![Owos](https://avatars.discourse-cdn.com/v4/letter/o/87869e/32.png) [@Owos](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FOwos)%5C
**Post date:** [January 14, 2023, 2:43pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fexplain-pytorch-model-bin%2F20744%2F2 "2023-01-14T14:43:47Z")

</div>

Hi @CCole have you been able to find a solution yet? I’m currently trying to understand this myself.

---

<div class="post-metadata">

**Author:** ![nrlaimn](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@nrlaimn](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnrlaimn)%5C
**Post date:** [April 4, 2024, 8:21am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fexplain-pytorch-model-bin%2F20744%2F3 "2024-04-04T08:21:01Z")

</div>

up im also looking for the solution

---

<div class="post-metadata">

**Author:** ![HZLSNG](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/hzlsng/32/42551_2.png) [@HZLSNG](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FHZLSNG)%5C
**Post date:** [March 5, 2025, 8:23am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fexplain-pytorch-model-bin%2F20744%2F4 "2025-03-05T08:23:33Z")

</div>

![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/6/9/69ab9e280362424908f4508f9bcbd7ff1a4328d2.png)  
Is this the error?  
how to solve it ,someone can help me ?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [March 5, 2025, 11:20am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fexplain-pytorch-model-bin%2F20744%2F5 "2025-03-05T11:20:04Z")

</div>

This issue?

> <https://github.com/StartHua/Comfyui_CXH_joy_caption/issues/52>
>
> !\[image\](https://github.com/user-attachments/assets/741d1730-23cb-4115-be7a-78f4…665e3534)
