Tutorial 2- Fine Tuning Pretrained Model On Custom Dataset Using 🤗 Transformer

  Рет қаралды 172,669

Krish Naik

Krish Naik

3 жыл бұрын

github: github.com/krishnaik06/Huggin...
In this tutorial, we will show you how to fine-tune a pretrained model from the Transformers library. In TensorFlow, models can be directly trained using Keras and the fit method. In PyTorch, there is no generic training loop so the 🤗 Transformers library provides an API with the class Trainer to let you fine-tune or train a model from scratch easily.
---------------------------------------------------------------------------------------------------------------------------------------------------------------
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for a few months and I love it! www.kite.com/get-kite/?...
Subscribe my vlogging channel
/ @krishnaikhindi
Please donate if you want to support the channel through GPay UPID,
Gpay: krishnaik06@okicici
Telegram link: t.me/joinchat/N77M7xRvYUd403D...
Please join as a member in my channel to get additional benefits like materials in Data Science, live streaming for Members and many more
/ @krishnaik06
Connect with me here:
Twitter: / krishnaik06
Facebook: / krishnaik06
instagram: / krishnaik06

Пікірлер: 176
@MrTabishMehdi
@MrTabishMehdi 3 жыл бұрын
Hi Krish, I was waiting for this series from very long. Thank you so much for starting it. Hope you will cover all the necessary and important topics related to this playlist. Cheers
@satyamtripathi1732
@satyamtripathi1732 3 жыл бұрын
krish sir sach main jis taraha se aap samjhate ho na koi nhi samjha sakta itni saari videos dekhi hai maine bert or transformer ki aap bahot easy way main samjhate ho sach main ek baar main direct dimaag main ghus jaati hai aapki baat thanku sir hum jaise gareebo ka bhala karne ke lea.
@tejpalkumawat776
@tejpalkumawat776 3 жыл бұрын
Most awaited series sir , thanks
@april147
@april147 Жыл бұрын
Very helpful and informative for beginners! Thanks a lot!
@RohanKumarSingh-kg7dt
@RohanKumarSingh-kg7dt Жыл бұрын
Please continue this series, it is very important.
@soumyaranjansethi1790
@soumyaranjansethi1790 3 жыл бұрын
Always great information from your channel sir🙏
@vatsaldin
@vatsaldin Жыл бұрын
Thank you Krish for making the video.You are doing great.God bless you.
@elyaabbas7216
@elyaabbas7216 3 жыл бұрын
we love it because your are great in work and perfect in every thing 😍
@shilpaprusty3319
@shilpaprusty3319 3 жыл бұрын
Great stuff,can you also show multilabel text classification with hugging face transformers
@rudraprasaddash3809
@rudraprasaddash3809 3 жыл бұрын
Sir, you made a mistake while doing the predictions. The model predictions were on your 0th index. But, you have taken it as 1. Thats' why in your confusion matrix there no FPs and FNs. But, rest all of the things are very good and insightful. Thank you sir🎩
@albinthomas4849
@albinthomas4849 2 жыл бұрын
So the model predictions is given by the probability of spam and ham right?
@travelthetropics6190
@travelthetropics6190 2 жыл бұрын
Yes, you are correct. I also found the same thing. Correct predtions could be obtained using below code. I got correct CNF matrix with this import numpy as np output = trainer.predict(test_dataset)[0] output = np.argmax(output, axis = - 1)
@shanukadulshan7154
@shanukadulshan7154 2 жыл бұрын
Hey bro. Can you help me find how to give custom inputs and see how it works?
@khouloudsafi1445
@khouloudsafi1445 2 жыл бұрын
@@travelthetropics6190 thank you, you saved my life :)
@khouloudsafi1445
@khouloudsafi1445 2 жыл бұрын
thank you, you saved my life :)
@hrishikeshbhagwat3378
@hrishikeshbhagwat3378 3 ай бұрын
awesome - so clear!
@aimatters5600
@aimatters5600 Жыл бұрын
oh my god. Sir are you physics wallah? I used to watch your physics lectures during high school. Right now I'm studying computer science in Canada. Thank you for your help.
@asieharati
@asieharati Жыл бұрын
Thank you Krish!
@asiftandel8750
@asiftandel8750 3 жыл бұрын
Great video Sir
@swetarajan1781
@swetarajan1781 8 ай бұрын
Could you please talk about how you decide the number of training epochs? And what are warmup steps?
@RedCloudServices
@RedCloudServices Жыл бұрын
Thank you i have a large corpus of manuals to fine tune which is not possible to prepare in Q&A format is there a method to use a sentence transformer to create a chatbot?
@satyamtripathi1732
@satyamtripathi1732 3 жыл бұрын
sir please make one video on any of your channel that as a data scientist what type of work you do in company and what type of work you were doing in past as a data scientist
@inFamous16
@inFamous16 Жыл бұрын
Hi Sir, I come to know that to change the pre-trained embedding size, we have to fine-tune model. As per the pre-trained BERT models provide 768 size pre-trained embeddings, Can you please tell if there is another way for the same?
@aishwarya3639
@aishwarya3639 2 жыл бұрын
hii krish will you please make a video on fine-tuning the fine-tuned model ? Its quite unique concept and not much content is available about it
@aswinpradeep1287
@aswinpradeep1287 2 жыл бұрын
TFDistilBertForSequenceClassification is for sentiment analysis right?, which classifier should I use for question-answer classification?
@zeenatzulfiqar5427
@zeenatzulfiqar5427 2 жыл бұрын
How to train transformer model on any of sentiment analysis dataset like movies reviews etc..? Plz make any video on it.
@YMuhammadyusuf
@YMuhammadyusuf Жыл бұрын
Hi thanks for your video. Why did you train only with 2 epochs? is it so powerful? that the model is working perfectly.
@eneko4562
@eneko4562 Жыл бұрын
Hi, I'am trying a different dataset with your tutorial, I am using a BERT Based transformer to fine tune with a protein dataset. However, when I get to the training part I get: "`Checkpoint` was expecting model to be a trackable object (an object derived from `Trackable`), got BertForMaskedLM". Do you know why could this be?
@junedansari5733
@junedansari5733 2 жыл бұрын
Hi Krish, how to fine-tune model for semantic search? I want to customize some text to be similar to some text. by default semantic search is giving the wrong result. so how do I correct it?
@TheIdimohammed
@TheIdimohammed 11 ай бұрын
Sir, I have learned a lot from this tutorial. I was able to use the code as it is. My question is, how do I load the fine-tun model for use? I have file save as config.json & tb_model.h5. how do I load these two files and test them. Thank you.
@rahulrajpandey8232
@rahulrajpandey8232 3 жыл бұрын
Why we converting our features to list, is this because tokenizers will preprocess it as raw data and make it a numpy array or dataframe for transformers ? Can't we pass numpy array or df to a tokenizer ?
@azizulkarim1622
@azizulkarim1622 4 ай бұрын
Hello sir, AS for TFTrainer is depriciate now, what to do for train the model now? I am using transformers version = 4.37.0
@santiagopendon
@santiagopendon 2 ай бұрын
Any solution for that?
@gina2237
@gina2237 2 жыл бұрын
Hi sir, how can we convert the encodings to dataset objects using pytorch?
@mahalerahulm
@mahalerahulm 2 жыл бұрын
Hello Krish, This tutorial is very nice and helpful! Can you also make one video on Seq2Seq some transformer model? I am not getting any proper source (tensorflow) for it. One which getting not able to unserstand. Fine Tuning Pretrained Model On Custom Dataset Using 🤗 Transformer for Seq2Seq
@mudassiraqeel8604
@mudassiraqeel8604 Жыл бұрын
my question is that in order do we need to manually create a dataset or is there any other way to generate a dataset to fine-tune on
@youwang9156
@youwang9156 3 ай бұрын
thank you so much, you saved my life !!!, just wonder when I trying to fine-tune a model, fine tune a pretrain based model or fine tuning a pre-trained model that has already been fine-tuned by others? which is better ?
@SVgaming988
@SVgaming988 3 ай бұрын
Hello
@satyamtripathi1732
@satyamtripathi1732 3 жыл бұрын
sir its a request please do all bert and transformer implementation using tf or keras only plsssssssssssss.
@help2office427
@help2office427 3 жыл бұрын
Sir, please explain some thing about deep generative models:
@mukeshkund4465
@mukeshkund4465 3 жыл бұрын
Just one question Krish..Have you done the preprocessing of text or transformer will take care of it ?? Instaed of sentiment analysis can we do document classification using transformers ?
@nullvoid7543
@nullvoid7543 2 жыл бұрын
Did you find any solution?
@generationgap416
@generationgap416 Жыл бұрын
A thank you would be nice. Be grateful or read the research paper yourself.
@Rider-jn6zh
@Rider-jn6zh Жыл бұрын
Kindly explain the role of all the parameters that u are using in a project.
@eliashossain450
@eliashossain450 Жыл бұрын
Hi Krish, can you please make a video on Wav2Vec2 model customization?
@loveofmylifesoumyarashmi9972
@loveofmylifesoumyarashmi9972 5 ай бұрын
plz make a vdo to use vision transformer for image classification.
@wilfredomartel7781
@wilfredomartel7781 2 жыл бұрын
Maybe an example of how to train SBERT with your own domain?
@dhivyabharathinithyanandha5289
@dhivyabharathinithyanandha5289 2 жыл бұрын
Thanks krish🙏🙏🙏🙏
@ankita_h
@ankita_h 4 ай бұрын
Hi Krish, It's really great learning from your videos. I have followed your approach and facing 1 issue. The target column of my dataset has 6 values and the pd.get_dummies gives me true, false values instead of 1 and 0. so when you applied y = list (pd.get_dummies(y, drop_first=True)['spam']), i can't apply that for my dataset. Can you please help me how do i do that and what all subsequent changes (if any) i have to make. It would be really helpful to me. Thanks!
@unsiahameed3483
@unsiahameed3483 Жыл бұрын
Hi, Can we use ALBERT model on top of it to see the difference?
@AnandP2812
@AnandP2812 3 жыл бұрын
Nice video. How do we use BERT's masked language model on a custom dataset? For example, if I have a dataset with over 100,000 tweets, can the masked language model be used to predict a tweet for an input? Example: "You look [MASK] today."
@mahalerahulm
@mahalerahulm 2 жыл бұрын
did you get source for this? I also need it
@BenjaminLiraLuttges
@BenjaminLiraLuttges 2 жыл бұрын
Is this updating all the layers of the model, or only the last ones?
@TheMarComplex
@TheMarComplex Жыл бұрын
Thank you! It was great. I tried it and got an error: "Method `strategy` requires TF." Any clue how to solve it?
@manjarinandimajumdar2642
@manjarinandimajumdar2642 Жыл бұрын
hello. I am getting this error "TypeError: '>' not supported between instances of 'NoneType' and 'int'" for the step trainer.train()
@ravindarmadishetty736
@ravindarmadishetty736 10 күн бұрын
@Krish Naik, Can we use this tf_model.h5 for transfer learning? I hope yes. If not suggest.
@sids2893
@sids2893 14 күн бұрын
Hello Sir, I was confused as to where we are using the positional encodings and the semantic encodings along with word2vec... could you please clarify this?
@kishorekarunakarapoojary4962
@kishorekarunakarapoojary4962 2 жыл бұрын
will it work for any text classification dataset?
@priyanakavasakan2894
@priyanakavasakan2894 6 ай бұрын
Hi krish, can you post the video regarding key value information extraction custom model building from scratch using layoutlmv3
@richardrgb6086
@richardrgb6086 10 ай бұрын
Hello! Can you fine-tuning T5?
@prasadjoshi8213
@prasadjoshi8213 9 ай бұрын
After entering wandb key, I got this error : TypeError: '>' not supported between instances of 'NoneType' and 'int'
@shushankyadav376
@shushankyadav376 Жыл бұрын
Hello @krishnaik06 can you please do a similar model for face recognition as well, for custom data set.
@joydhritichoudhury6333
@joydhritichoudhury6333 2 жыл бұрын
Hello Mr. Naik. Great video sir. I have followed your code step by step and faced a bizarre error. TypeError: '>' not supported between instances of 'NoneType' and 'int' Searched everywhere couldn't find the solution. Can you please help me with this. It would be a great help. Thank you.
@ShahidKhan-er1sw
@ShahidKhan-er1sw 2 жыл бұрын
same error for me bro😥
@vishalsingh-tg1ie
@vishalsingh-tg1ie 2 жыл бұрын
I also faced the same issue. Have you find the solution? @joydhriti
@imamamansoor5174
@imamamansoor5174 2 жыл бұрын
Same error! have you found the solution?
@joydhritichoudhury6333
@joydhritichoudhury6333 2 жыл бұрын
Yes, on the official page, there is another way to train your model. I trained my model using that. It takes longer though. Almost 9 hours to train a single model
@imamamansoor5174
@imamamansoor5174 2 жыл бұрын
@@joydhritichoudhury6333 yes i am doing it right now using code from the official page, almost 6.5 hrs has passed, hopefully it will end successfully.
@aiantt
@aiantt 2 ай бұрын
how to use the train model for chatbot
@MotunBizAcademy
@MotunBizAcademy 11 ай бұрын
how long does this fine-tuning process take please?
@lakshsinghania
@lakshsinghania 16 күн бұрын
sir, when analyzed the data its imbalanced the spam category is less as cmp to ham so need to balance it first
@SeyyedMohammadLoghmanDastgheyb
@SeyyedMohammadLoghmanDastgheyb 2 жыл бұрын
Hi :) Why did you get 100% accuracy? The confusion matrix is showing that. There is only two epoch and it must be something wrong about it. I should admit that I have done the steps for *electra-base-discriminator* and get the same result as you for two different datasets. Can you please check why we get 100% accuracy?
@Memes-Hubwtf
@Memes-Hubwtf Жыл бұрын
Cause he used as a predict array - test_dataset that was used as a evaluation dataset.
@niranjanjamkhande3773
@niranjanjamkhande3773 3 жыл бұрын
I recently joined one company as DS intern. While watching your video, i understand it pretty well. But while working on anything in company, self confidence just goes down. Why this happens? It happens with everyone or with me only?
@kskeshavarao8522
@kskeshavarao8522 3 жыл бұрын
mai bhi join karke batata hu bhai
@soulwreckedyouth877
@soulwreckedyouth877 2 жыл бұрын
I think this happens with more or less everyone as our job is full of impressing buzz words etc. Don't let this stuff get you down but stick to your passion. After a while you ll be the confident one....
@karen-7057
@karen-7057 Жыл бұрын
I think it's common and the fact that DS in real life isn't like most tutorials or most courses doesn't help. People should teach using real life examples, of real datasets, with clear and real problems to solve in mind.... You may think because you saw a few videos that x and y and z, and then the real world hits. If you are an intern or a junior stay cool! Don't push yourself. everyone that has done your job knows exactly how you are feeling. It's also okay to be humble while one learns, people with more seniority appreciate it.
@harshrajput6966
@harshrajput6966 Жыл бұрын
Can you share the exact documentation link?
@AshishYadav-mu1rd
@AshishYadav-mu1rd 3 жыл бұрын
I wish it was somewhat different from 🤗 documentation example
@abdulhannan8541
@abdulhannan8541 2 жыл бұрын
can I train this on 125 class dataset.?
@harissaeed5811
@harissaeed5811 Жыл бұрын
train_encoding = tokenizer(X_train, truncation=True, padding=True), ValueError: Input is not valid. Should be a string, a list/tuple of strings or a list/tuple of integers. this error is not remove can some1 please help me
@alexismadelenat8667
@alexismadelenat8667 Жыл бұрын
Hey, I have the same issue. Did you manage to solve it ?
@mdraihanulislamtomal6064
@mdraihanulislamtomal6064 5 ай бұрын
If you could kindly make a video on translation model on custom made dataset like hindi to english language. and show the accuracy result.
@PhucPham-my2qb
@PhucPham-my2qb 2 ай бұрын
so how if we more than two labels, can you help me ?
@pratimarathore1390
@pratimarathore1390 3 жыл бұрын
Here we are freezing the top layers of the transformer and just training the classification layer isnt ? When we are instroducing our custom data , that is changing weights for classification task only isnt
@danielesanacore3547
@danielesanacore3547 2 жыл бұрын
Hello, thanks for the video :) . I had one problem arising when training the model (around minute 11 in your video). I got this error when using your notebook on Colab and launching the instruction "trainer.train()": TypeError: '>' not supported between instances of 'NoneType' and 'int'. Does anyone know what I should do? Any help would be really appreciated
@ZEA_TATA
@ZEA_TATA 2 жыл бұрын
Same error :(
@khouloudsafi1445
@khouloudsafi1445 2 жыл бұрын
I got the same error, I solved it alhamdolellah by adding eval_steps = 10 as an argument, to the TFTrainingArguments(
@khouloudsafi1445
@khouloudsafi1445 2 жыл бұрын
@@ZEA_TATA I got the same error, I solved it alhamdolellah by adding eval_steps = 10 as an argument, to the TFTrainingArguments(
@streamhub5372
@streamhub5372 2 жыл бұрын
same here
@ZEA_TATA
@ZEA_TATA 2 жыл бұрын
@@khouloudsafi1445 Shukriya , i will also try that and will see if it works out for me.
@udaygupta5075
@udaygupta5075 4 ай бұрын
How can we deploy an app made on embeddings like these?
@-_BahauddinTaha
@-_BahauddinTaha Жыл бұрын
What if i have a bengali language dataset? Can we do the same in that scenario?
@SodaPy_dot_com
@SodaPy_dot_com 20 күн бұрын
first time seeing this
@bijaynayak2346
@bijaynayak2346 2 жыл бұрын
Hi Krish , can u do some sentence similarity modeling exercise
@kumargaurav5155
@kumargaurav5155 4 ай бұрын
hi Krish, it would be great to have sentence similarity as well. I was wondering how do we deal with multiple features of training data (like Sentence 1, Sentence 2)
@shivadnya780
@shivadnya780 3 ай бұрын
i tried doing it but not able to import TFTrainer
@rakeshreddy4827
@rakeshreddy4827 3 жыл бұрын
Hello sir, I appreciate your work for knowledge sharing. I do have one doubt regarding the custom dataset which you have used, you are getting 100 accuracy on the test dataset. I think it is not possible I have seen in some papers they got 95 accuracy is the highest by using the BERT model. Please can you reply to this comment?
@albinthomas4849
@albinthomas4849 2 жыл бұрын
Hi, yess the label_ids are giving whatever was given by us.
@shanukadulshan7154
@shanukadulshan7154 2 жыл бұрын
Need help with loading the saved model :(
@krishnasaiteja5618
@krishnasaiteja5618 3 жыл бұрын
Sir, how can we extend the same for multiclass classification or multilabel...please give me a solution.
@score9255
@score9255 2 жыл бұрын
yes sir,plz explain
@jackma6083
@jackma6083 10 ай бұрын
Is it a CPU based on training.
@shanukadulshan7154
@shanukadulshan7154 2 жыл бұрын
I'm trying to do sentiment analysis and my dataset's label column have 3 values. 0 - neutral , 1 - happy, 2 - sad. (not true or false like yours) Is there anyway to work with that?
@gina2237
@gina2237 2 жыл бұрын
try factorize
@streamhub5372
@streamhub5372 2 жыл бұрын
have you been able to do this?
@karen-7057
@karen-7057 Жыл бұрын
Ahhh do you think a sentence can be both happy and sad? If not, you could try to encode the features in a single column using the encoding you used here and then follow the tutorial as presented.
@testingemailstestingemails4245
@testingemailstestingemails4245 2 жыл бұрын
how to do that trained huggingface model on my own dataset? how i can start ? i don't know the structure of the dataset? help.. very help how I store voice and how to lik with its text how to orgnize that I an looking for any one help me in this planet Should I look for the answer in Mars?
@susanhuang2694
@susanhuang2694 Жыл бұрын
Do you know why do I get error: "TypeError: '>' not supported between instances of 'NoneType' and 'int' " after trainer.train()?
@sujaljoshi3478
@sujaljoshi3478 Жыл бұрын
Solve it by adding eval_steps = 10 as an argument, to the TFTrainingArguments(
@ayu.sheesh
@ayu.sheesh Жыл бұрын
@@sujaljoshi3478 how much time it took to train your model even after this step?
@user-vp5ke9vz3i
@user-vp5ke9vz3i 3 ай бұрын
Hi, Krish, when i run i got this error ImportError: cannot import name 'TFTrainer' from 'transformers' please help me to resolve it
@shiri_miri98
@shiri_miri98 2 ай бұрын
It is because TFTrainer is depreciated in the latest transformer versions, try reinstalling with older versions it should work!
@kkamit0106
@kkamit0106 2 жыл бұрын
Hi Krish ..Getting Error " TypeError: '>' not supported between instances of 'NoneType' and 'int' ' in trainer.train() please help
@danielesanacore3547
@danielesanacore3547 2 жыл бұрын
same thing :/
@purveshjain4296
@purveshjain4296 2 жыл бұрын
@@danielesanacore3547 Seems to be an issue with the new version of transformers. Installing version 4.6.0 worked for me. pip install transformers==4.6.0
@ShahidKhan-er1sw
@ShahidKhan-er1sw 2 жыл бұрын
Anyone face this issue pls help me to resolve this issue TypeError: '>' not supported between instances of 'NoneType' and 'int'
@mufseeramusthafa2170
@mufseeramusthafa2170 2 жыл бұрын
install specific version of transformers
@danielesanacore3547
@danielesanacore3547 2 жыл бұрын
@@mufseeramusthafa2170 which version do u mean?
@mesaygemeda2867
@mesaygemeda2867 Жыл бұрын
I faced the same thing. how did you solve it?
@shivadnya780
@shivadnya780 3 ай бұрын
is anyone facing issues installing TFTrainer ?
@rahulsbytes
@rahulsbytes Ай бұрын
Please Fine Tune the "Question-Answering Model" with own datasets....
@shrutisingh9801
@shrutisingh9801 4 ай бұрын
where is rest videos? i want complete course on hugging face. and i dont have card, can i pay through upi id please?
@himankalita4043
@himankalita4043 Жыл бұрын
Hello everyone, can anyone please help me out as I am getting TypeError: '>' not supported between instances of 'NoneType' and 'int'
@amitavroydev
@amitavroydev 4 ай бұрын
same error
@fidamohammad456
@fidamohammad456 2 жыл бұрын
why you giving y_test of test data when you training the model. thats why its giving 100% accuracy this is not the correct way i think so
@prabhatale1135
@prabhatale1135 2 жыл бұрын
typeerror: '>' not supported between instances of 'nonetype' and 'int' trainer.train() is throwing this error... Have anyone faced this? If yes, please help me...
@rahulagarwal988
@rahulagarwal988 2 жыл бұрын
Please update the answer here if you able to solve it
@prabhatale1135
@prabhatale1135 2 жыл бұрын
@@rahulagarwal988 I have trained it the other way.. this doesnot works...
@rahulagarwal988
@rahulagarwal988 2 жыл бұрын
@prabhat, even I trained it with keras as given in the documentation and it work with that . Please let me know which way you used for training
@ShahidKhan-er1sw
@ShahidKhan-er1sw 2 жыл бұрын
Bro, I have facing the same issue, can u help to resolve the issue, how can you resolve this issue??
@ShodaiThox
@ShodaiThox 2 жыл бұрын
Hello, if you face this problem, just avoid using TFTrainer as it's deprecated, so instead just use the tensorflow/keras approach by using this as given in the documentation: optimizer = tf.keras.optimizers.Adam(learning_rate=5e-5) model.compile(optimizer=optimizer, loss=model.compute_loss) # can also use any keras loss fn model.fit(train_dataset.shuffle(1000).batch(16), epochs=3, batch_size=16) Of course you can change everything in here such as the optimizer, loss, metrics and/or adding more layers to the current architecture of the model, hope it helps and happy learning!
@khalidalnahyan2122
@khalidalnahyan2122 11 ай бұрын
Hello, I got an error with the TFTrainingArguments: --------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) File ~/anaconda3/lib/python3.10/site-packages/transformers/utils/import_utils.py:1076, in _LazyModule._get_module(self, module_name) 1075 try: -> 1076 return importlib.import_module("." + module_name, self.__name__) 1077 except Exception as e: File ~/anaconda3/lib/python3.10/importlib/__init__.py:126, in import_module(name, package) 125 level += 1 --> 126 return _bootstrap._gcd_import(name[level:], package, level) File :1050, in _gcd_import(name, package, level) File :1027, in _find_and_load(name, import_) File :1006, in _find_and_load_unlocked(name, import_) File :688, in _load_unlocked(spec) File :883, in exec_module(self, module) File :241, in _call_with_frames_removed(f, *args, **kwds) File ~/anaconda3/lib/python3.10/site-packages/transformers/models/distilbert/modeling_tf_distilbert.py:34 26 from ...modeling_tf_outputs import ( 27 TFBaseModelOutput, 28 TFMaskedLMOutput, (...) 32 TFTokenClassifierOutput, 33 ) ---> 34 from ...modeling_tf_utils import ( 35 TFMaskedLanguageModelingLoss, 36 TFModelInputType, 37 TFMultipleChoiceLoss, 38 TFPreTrainedModel, 39 TFQuestionAnsweringLoss, 40 TFSequenceClassificationLoss, 41 TFTokenClassificationLoss, 42 get_initializer, 43 keras_serializable, 44 unpack_inputs, 45 ) 46 from ...tf_utils import shape_list, stable_softmax File ~/anaconda3/lib/python3.10/site-packages/transformers/modeling_tf_utils.py:39 38 from huggingface_hub import Repository, list_repo_files ---> 39 from keras.saving.hdf5_format import save_attributes_to_hdf5_group 40 from transformers.utils.hub import convert_file_size_to_int, get_checkpoint_shard_files ModuleNotFoundError: No module named 'keras.saving.hdf5_format' The above exception was the direct cause of the following exception: RuntimeError Traceback (most recent call last) Cell In[21], line 1 ----> 1 from transformers import TFDistilBertForSequenceClassification, TFTrainer, TFTrainingArguments 3 training_args = TFTrainingArguments( 4 output_dir='./results', # output directory 5 num_train_epochs=2, # total number of training epochs (...) 11 logging_steps=10, 12 ) File :1075, in _handle_fromlist(module, fromlist, import_, recursive) File ~/anaconda3/lib/python3.10/site-packages/transformers/utils/import_utils.py:1067, in _LazyModule.__getattr__(self, name) 1065 elif name in self._class_to_module.keys(): 1066 module = self._get_module(self._class_to_module[name]) -> 1067 value = getattr(module, name) 1068 else: 1069 raise AttributeError(f"module {self.__name__} has no attribute {name}") File ~/anaconda3/lib/python3.10/site-packages/transformers/utils/import_utils.py:1066, in _LazyModule.__getattr__(self, name) 1064 value = self._get_module(name) 1065 elif name in self._class_to_module.keys(): -> 1066 module = self._get_module(self._class_to_module[name]) 1067 value = getattr(module, name) 1068 else: File ~/anaconda3/lib/python3.10/site-packages/transformers/utils/import_utils.py:1078, in _LazyModule._get_module(self, module_name) 1076 return importlib.import_module("." + module_name, self.__name__) 1077 except Exception as e: -> 1078 raise RuntimeError( 1079 f"Failed to import {self.__name__}.{module_name} because of the following error (look up to see its" 1080 f" traceback): {e}" 1081 ) from e RuntimeError: Failed to import transformers.models.distilbert.modeling_tf_distilbert because of the following error (look up to see its traceback): No module named 'keras.saving.hdf5_format'
@tarunsubramanian9792
@tarunsubramanian9792 3 жыл бұрын
It throws, ValueError: Dimensions X and X are not compatible Where X is a random number
@priyam66
@priyam66 Жыл бұрын
import tensorflow as tf train_dataset=tf.data.Dataset.from_tensor_slices((dict(train_encoding),y_train)) test_dataset=tf.data.Dataset.from_tensor_slices((dict(test_encoding),y_test))
@priyam66
@priyam66 Жыл бұрын
Try this to fix up the issue.
@syedasifiqbal7260
@syedasifiqbal7260 6 ай бұрын
Sir can u share your cvs data file with us ?
@pranavprajapati5737
@pranavprajapati5737 Жыл бұрын
TFtrainer is depracted now so refer to the official hugging face doc
@vinaynaik953
@vinaynaik953 3 жыл бұрын
100% accuracy possible ?
@rudraprasaddash3809
@rudraprasaddash3809 3 жыл бұрын
no, that's the issue with ML. If you have very bad results, you are unhappy and if you have excellent results you should worry. In this case, sir has made a mistake while extracting the model prediction. He has taken it on index 1, which should be 0.
@raewallace8711
@raewallace8711 3 жыл бұрын
@@rudraprasaddash3809 Thanks!
@deepaklonare9497
@deepaklonare9497 11 ай бұрын
I am getting error as "FileNotFoundError: [Errno 2] No such file or directory: 'SMSSpamCollection'"
@vijaykant52
@vijaykant52 3 жыл бұрын
Let’s say I taught you four algorithm (A, B, C, D) for classification. I have collected one new dataset which contains 1000 observations with 11 features. We hired a team of experts to label the data class into either X or Y, they took 15 days to label 1000 entries. In next one month we‘ll also collect 1000 more observation. What strategy we need to follow to speed up our work. How can one answer this question?
@Ankit-hs9nb
@Ankit-hs9nb 2 жыл бұрын
1. you can try to test those new 1000 with the already trained model 2. use UnSupervised learning to classify those new 1000 and get it checked from a SME. Correct the doubted ones. 3. train model on all 2000
@karen-7057
@karen-7057 Жыл бұрын
@@Ankit-hs9nb good answer, I agree. putting an unsurpervised layer between humans and their tasks would speed things up because 11 features is a lot. Automated knowledge must be built about these features!
@vishnusureshperumbavoor
@vishnusureshperumbavoor Ай бұрын
2021 💀
@user-iq9ds4wi4o
@user-iq9ds4wi4o Жыл бұрын
I am getting below prediction output when I try the above on a custom multi class classification dataset. Does anyone have an idea, why this is happening, or how I can correct it? @krishnaik06 PredictionOutput(predictions=array([[nan, nan], [nan, nan], [nan, nan], ..., [nan, nan], [nan, nan], [nan, nan]], dtype=float32), label_ids=array([0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
@prasadjoshi8213
@prasadjoshi8213 9 ай бұрын
It asks me : "wandb: Paste an API key from your profile and hit enter, or press ctrl+c to quit: ··········" while running code - with training_args.strategy.scope(): Then I entered wandb key, I got this error : TypeError: '>' not supported between instances of 'NoneType' and 'int'
@harissaeed5811
@harissaeed5811 Жыл бұрын
OperatorNotAllowedInGraphError Traceback (most recent call last) in 12 ) 13 ---> 14 trainer.train() 15 why i face error on trainer.train()
@bhaisahab1801
@bhaisahab1801 10 ай бұрын
same i am also facing same error
@bhaisahab1801
@bhaisahab1801 10 ай бұрын
Have you find any solution till now
@tehzeebsheikh165
@tehzeebsheikh165 Ай бұрын
Hi have you solve the issue? Please reply
Fine Tune Transformers Model like BERT on Custom Dataset.
23:14
Pradip Nichite
Рет қаралды 38 М.
Wait for the last one! 👀
00:28
Josh Horton
Рет қаралды 111 МЛН
Homemade Professional Spy Trick To Unlock A Phone 🔍
00:55
Crafty Champions
Рет қаралды 58 МЛН
Вечный ДВИГАТЕЛЬ!⚙️ #shorts
00:27
Гараж 54
Рет қаралды 7 МЛН
Khó thế mà cũng làm được || How did the police do that? #shorts
01:00
Tutorial 1-Transformer And Bert Implementation With Huggingface
24:30
The Secret to 90%+ Accuracy in Text Classification
10:34
Pritish Mishra
Рет қаралды 40 М.
Simple Training with the 🤗 Transformers Trainer
26:42
HuggingFace
Рет қаралды 34 М.
HuggingFace Crash Course - Sentiment Analysis, Model Hub, Fine Tuning
38:12
Fine-tuning Large Language Models (LLMs) | w/ Example Code
28:18
Shaw Talebi
Рет қаралды 259 М.
Things Required To Master Generative AI- A Must Skill In 2024
15:01
Wait for the last one! 👀
00:28
Josh Horton
Рет қаралды 111 МЛН