Missing modules for handwritten text generation
$ trdg -c 3 -w 5 -f 64 -b 1 -hw
/home/sukumar/miniconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/sukumar/miniconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/sukumar/miniconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/sukumar/miniconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/home/sukumar/miniconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/home/sukumar/miniconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
/home/sukumar/miniconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/sukumar/miniconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/sukumar/miniconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/sukumar/miniconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/home/sukumar/miniconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/home/sukumar/miniconda3/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
Missing modules for handwritten text generation.
0%| | 0/3 [00:00<?, ?it/s]multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/sukumar/miniconda3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/home/sukumar/miniconda3/lib/python3.7/site-packages/trdg/data_generator.py", line 21, in generate_from_tuple
cls.generate(*t)
File "/home/sukumar/miniconda3/lib/python3.7/site-packages/trdg/data_generator.py", line 65, in generate
image, mask = handwritten_text_generator.generate(text, text_color)
NameError: name 'handwritten_text_generator' is not defined
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/sukumar/miniconda3/bin/trdg", line 8, in <module>
sys.exit(main())
File "/home/sukumar/miniconda3/lib/python3.7/site-packages/trdg/run.py", line 432, in main
total=args.count,
File "/home/sukumar/miniconda3/lib/python3.7/site-packages/tqdm/std.py", line 1081, in __iter__
for obj in iterable:
File "/home/sukumar/miniconda3/lib/python3.7/multiprocessing/pool.py", line 748, in next
raise value
NameError: name 'handwritten_text_generator' is not defined
0%|
@sukumar-varma
Is this error solved? Do you get solution?
Hi! This was never an error, it's my bad that I didn't answer.
To use handwritten text generation, you will need Tensorflow and a few more requirements that are not in the basic requirements.txt because it would slow down the overwhelming majority of users who don't use it.
The error will go away if you install the dependencies listed here: https://github.com/Belval/TextRecognitionDataGenerator/blob/master/requirements-hw.txt
@Belval
Thanks for your answer. But the error remains the same after installing requirements-hw.txt.
I want to generate handwritten based on text extract from Wikipedia and save generated handwritten images and labels.
I follow the exact documentation but not get around. I am using python 3.7.
I think NameError: name 'handwritten_text_generator' is not defined Error says that this module not defined or combine properly.
If any more hint, it would be more helpful.
Hi, I had the same issue. I manually installed opt-einsum and astunparse , that fixed things.
Hi everyone! I'm using python 3.7, I installed all the librearies included in "requirements-hw.txt" and also opt-einsum and astunparse but the error still remains (NameError: name 'handwritten_text_generator' is not defined)
Any suggestions? thank you all!!
Hi everyone! I'm using python 3.7, I installed all the librearies included in "requirements-hw.txt" and also opt-einsum and astunparse but the error still remains (NameError: name 'handwritten_text_generator' is not defined)
Any suggestions? thank you all!!
you should goto your current pyhton site-packages path/trdg-1.7.0-py3.6.egg/trdg/
edit data_generator.py
Replace from trdg import computer_text_generator, background_generator, distorsion_generator as from trdg import computer_text_generator, background_generator, distorsion_generator, handwritten_text_generator