Skip to content

The total number of parameters of GPT2 model I got is different from that in the book #622

Closed Answered by rasbt
Jessen-Li asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the comments! It's interesting and weird that the numbers may be different. I suspect this is maybe due to some minor code difference that is easy to overlook.

@Jessen-Li could you try to run the following standalone code and see what you get? If it is 163,009,536 then there's perhaps some small discrepancy in your code. If not, we can investigate further.

# This file collects all the relevant code that we covered thus far
# throughout Chapters 2-4.
# This file can be run as a standalone script.

import tiktoken
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader

#####################################
# Chapter 2
#################################…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@rasbt
Comment options

Answer selected by Jessen-Li
@Darakhsh1999
Comment options

@Jessen-Li
Comment options

@rasbt
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants