Skip to content
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

TypeError: load_dict() got an unexpected keyword argument 'lang' #4

Open
zzinzziny opened this issue Nov 28, 2022 · 6 comments
Open

Comments

@zzinzziny
Copy link

File ~/imt/comic-text-detector/text_rendering.py:170, in TextLinesSampler.init(self, page_size, sampler_dict)
168 self.page_w, self.page_h = page_size
169 self.lang = sampler_dict['lang']
--> 170 self.lang_dict = load_dict(lang=self.lang)
171 self.orientation_sampler = ScaledSampler(sampler_dict['orientation'])
172 self.numlines_sampler = ScaledSampler(sampler_dict['num_lines'])

TypeError: load_dict() got an unexpected keyword argument 'lang'

In example.ipynb file, the code isn't work with error messages.
what can I do??

@dmMaze
Copy link
Owner

dmMaze commented Dec 14, 2022

this error is related to trdg.utils.load_dict, you may try to update trdg to the latest version

@zzinzziny
Copy link
Author

zzinzziny commented Dec 14, 2022

Oh..... I already updated trdg to latest version. 😂
Isn't another method to solve it?

@dmMaze
Copy link
Owner

dmMaze commented Dec 15, 2022

Oh..... I already updated trdg to latest version. 😂 Isn't another method to solve it?

There must be something wrong with your installed trdg according to this error. Maybe reinstalling it would solve the problem.

Besides, my trdg==1.7.0, and here is it's load_dict method:
image

You can also copy these dicts/lang.txt file and implement your own load_lang method

@zzinzziny
Copy link
Author

Thank you for your solutions.
But I have a more question yet.

How can I set dicts/lang.txt file? what is dicts/lang.txt file?

@dmMaze
Copy link
Owner

dmMaze commented Dec 15, 2022

Thank you for your solutions. But I have a more question yet.

How can I set dicts/lang.txt file? what is dicts/lang.txt file?

Can you navigate aforementioned load_dict method in your installed trdg code base?

@zzinzziny
Copy link
Author

zzinzziny commented Dec 15, 2022

Can you navigate aforementioned load_dict method in your installed trdg code base?

yes, It's possible.
But, error occured....

File "/data/anaconda3/envs/j/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3805, in get_loc
raise KeyError(key) from err
KeyError: 'font

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants