-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fine-tuning a Model on Your Own Data tutorial throws error #2881
Comments
Hi, @erenaldis could you provide us with the entirety of your code that was used when this error occurred? This will make it easier for us to help debug your problem. Additionally, could you provide us with a few example entries of data from your |
Hey @erenaldis, we need a bit more information from you to be able to help. So:
|
Thank you for your reply @ZanSara @sjrl
Here is a sample of it:
I am running on Colab, with GPU and high-ram |
Thank you! This is a real bug in training, we're actively working on it (#2886). The fix might be out today or tomorrow, so stay tuned 😊 |
TypeError: forward() got an unexpected keyword argument 'passage_start_t'
a bunch of the parameters in "batch" also seem to throw the same error upon further investigation, such as "start_of_word"
It seems like it is attempting to train a distilbert base like model rather than BertForQuestionAnswering.
TypeError Traceback (most recent call last)
in ()
5 # reader.train(data_dir=data_dir, train_filename="dev-v2.0-test.json", use_gpu=True, n_epochs=1, save_dir="my_model")
6 # data_dir = "PATH/TO_YOUR/TRAIN_DATA"
----> 7 reader.train(data_dir=data_dir, train_filename="answers.json", use_gpu=True, n_epochs=1, save_dir="my_model")
3 frames
/usr/local/lib/python3.7/dist-packages/haystack/nodes/reader/farm.py in train(self, data_dir, train_filename, dev_filename, test_filename, use_gpu, devices, batch_size, n_epochs, learning_rate, max_seq_len, warmup_proportion, dev_split, evaluate_every, save_dir, num_processes, use_amp, checkpoint_root_dir, checkpoint_every, checkpoints_to_keep, caching, cache_path)
419 checkpoints_to_keep=checkpoints_to_keep,
420 caching=caching,
--> 421 cache_path=cache_path,
422 )
423
/usr/local/lib/python3.7/dist-packages/haystack/nodes/reader/farm.py in _training_procedure(self, data_dir, train_filename, dev_filename, test_filename, use_gpu, devices, batch_size, n_epochs, learning_rate, max_seq_len, warmup_proportion, dev_split, evaluate_every, save_dir, num_processes, use_amp, checkpoint_root_dir, checkpoint_every, checkpoints_to_keep, teacher_model, teacher_batch_size, caching, cache_path, distillation_loss_weight, distillation_loss, temperature, tinybert, processor)
325
326 # 5. Let it grow!
--> 327 self.inferencer.model = trainer.train()
328 self.save(Path(save_dir))
329
/usr/local/lib/python3.7/dist-packages/haystack/modeling/training/base.py in train(self)
289 batch = {key: batch[key].to(self.device) for key in batch}
290
--> 291 loss = self.compute_loss(batch, step)
292
293 # Perform evaluation
/usr/local/lib/python3.7/dist-packages/haystack/modeling/training/base.py in compute_loss(self, batch, step)
373 def compute_loss(self, batch: dict, step: int) -> torch.Tensor:
374 # Forward & backward pass through model
--> 375 logits = self.model.forward(**batch)
376 per_sample_loss = self.model.logits_to_loss(logits=logits, global_step=self.global_step, **batch)
377 return self.backward_propagate(per_sample_loss, step)
TypeError: forward() got an unexpected keyword argument 'passage_start_t'
The text was updated successfully, but these errors were encountered: