Belval / TextRecognitionDataGenerator

A synthetic data generator for text recognition
MIT License
3.24k stars 966 forks source link

python run.py -c 10 TypeError: generate() takes 27 positional arguments but 31 were given #257

Closed monkeycc closed 2 years ago

monkeycc commented 2 years ago
F:\TextRecognitionDataGenerator\trdg> python run.py -c 10

Missing modules for handwritten text generation.
  0%|                                                                                           | 0/10 [00:00<?, ?it/s]Missing modules for handwritten text generation.
  0%|                                                                                           | 0/10 [00:00<?, ?it/s]
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "E:\anaconda3\envs\OCR\lib\multiprocessing\pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "E:\anaconda3\envs\OCR\lib\site-packages\trdg\data_generator.py", line 21, in generate_from_tuple
    cls.generate(*t)
TypeError: generate() takes 27 positional arguments but 31 were given
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "run.py", line 487, in <module>
    main()
  File "run.py", line 432, in main
    for _ in tqdm(
  File "E:\anaconda3\envs\OCR\lib\site-packages\tqdm\std.py", line 1195, in __iter__
    for obj in iterable:
  File "E:\anaconda3\envs\OCR\lib\multiprocessing\pool.py", line 868, in next
    raise value
TypeError: generate() takes 27 positional arguments but 31 were given
monkeycc commented 2 years ago

In the case of version 1.6.0 (installed through pip), there are 27 parameters of the function, but in the case of master branch (git clone), 3 are added and thus 30. When using the master code, you should check if the 1.6.0 version of trdg is used when importing. solution: sync source to master or 1.6.0. should not be mixed.

在版本1.6.0(通过pip安装)的情况下, 函数有27个参数, 但在主分支(git clone)的情况下,增加了3个参数,因此增加了30个参数。

解决方案:删除pip版本 从源码安装

SilvaQ commented 2 years ago

这个问题有啥更好的解决方案了么