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

error runing test.py file in cpu mode. #12

Open
ajberenstein opened this issue Feb 9, 2023 · 3 comments
Open

error runing test.py file in cpu mode. #12

ajberenstein opened this issue Feb 9, 2023 · 3 comments

Comments

@ajberenstein
Copy link

Hi, first of all let me congratulate you for this fantastic work.
After following the installation instructions I tried to run the usage example in cpu_mode
python test.py --imgfile=example/sample.jpg --use_cpu=1
and I get the following error:
[E 230209 19:16:52 test:125] Unexpected error has occurred
Traceback (most recent call last):
File "test.py", line 123, in
main(args)
File "test.py", line 88, in main
test(
File "test.py", line 53, in test
vd, rec_img = vectorize(pil_img, inps, outs)
File "/home/ariel/repos/derendering-text/src/modules/postprocess/vector.py", line 114, in vectorize
tb_param, effect_param, effect_visibility = extract_rendering_params(
File "/home/ariel/repos/derendering-text/src/modules/postprocess/manipulate.py", line 286, in extract_rendering_params
tb_param = get_textblob_param_with_affine(
File "/home/ariel/repos/derendering-text/src/modules/postprocess/rpe.py", line 515, in get_textblob_param_with_affine
text_form_dto = TextFormData(
TypeError: init() missing 1 required positional argument: 'text_index'

what I can see in the file dto_skia.py, is that the dataclass TextFromData requires a text_index: int value that is not set in rpe.py file. Please, let me know if you need more info in order to reproduce this error.
Best,
A.

@ajberenstein
Copy link
Author

ajberenstein commented Feb 13, 2023

Udate: after cloning the whole repo, installing requirements, upload provided weights and generating util_lib.gen_pams, the tes.py code (in GPU mode) ends with the same error.

Session Info:
['Python 3.8.10',
'torch==1.13.1+cu116',
'torchviosion==0.14.1+cu116',
'h5py==3.1.0',
'skia-python==87.5',
'fonttools==4.38.0',
'logzero==1.7.0',
'opencv-python==4.6.0.66',
'pyclipper==1.3.0.post4',
'scikit-image==0.18.3',
'scikit-learn==1.0.2',
'scipy==1.7.3']

@shimoda-uec
Copy link
Collaborator

Thank you for reporting the error.
I fixed it.

@ajberenstein
Copy link
Author

Thanks Shimoda, It worked.
best,
A.

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