question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

learner.save_model gives KeyError while saving tokenizer/vocab file

See original GitHub issue

I’m trying to run the multilabel classification model and while saving the model it give me an error on vocab file learner.save_model() gives below error: image

Is this because I have not specified some path or because I’m not using a pretrained model path from local as in sample notebook.

My learner config is as below: image

DataBunchConfig as below: image

Any help appreciated. Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
aaronbrielcommented, Apr 21, 2020
1reaction
aaronbrielcommented, Apr 16, 2020

You need to pass save_model a Path to the directory you wish to save it to.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python KeyError During Save/Load - Stack Overflow
A key error is when the key for a dictionary doesn't exist. For example, person = {name: 'joe', age: 41}.
Read more >
QAT model saving bug : KeyError ... - GitHub
Command to run : python sample_qat.py. I have a simple model with input layer and a depthwise conv2d layer. I quantize this model...
Read more >
How to fix Python KeyError Exceptions in simple steps?
Know about Python KeyError Exception. And learn how to handle exceptions in Python. A detailed guide to Errors and Exceptions in Python.
Read more >
Python KeyError Exceptions and How to Handle Them
In this tutorial, you'll learn how to handle Python KeyError exceptions. They are often caused by a bad key lookup in a dictionary,...
Read more >
What is KeyError in Python? Dictionary and Handling Them
Now let us see what a key error is. KeyError in Python is raised when you attempt to access a key that is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found