pay20y / sar_tf Goto Github PK
View Code? Open in Web Editor NEWThis is an implementation of Show, Attend and Read with tensorflow
This is an implementation of Show, Attend and Read with tensorflow
How can i train with multi gpus?
I set parser.add_argument('-g', '--gpus', type=str, default='0,1')
but nvidia-smi shows only gpu0 is computing
Is the library saving scalars? I'm not able to see them on TensorBoard.
Am I missing something?
I used the same data and the same configuration to train my handwritten Chinese recognition. The first time I iterated 4000 times, I got 50% acc, and it can be increased to about 80% later, but in the second experiment,the loss didn't decrease, the accuracy was not increase at all, it was always 5%
hi~can you provide the pretrained model ?Thanks
I am reading torch implementation, your implementation and the pytorch implementation. I found that there are mask in your implementation and torch implementation, but there is no mask in pytorch implementation. Is the role of mask is to get the valid ones? If there is no mask, what will the performance and the result be like?
I am training the pytorch implementation on handwritten dataset, I found that there is a lot of repeat in the decoded result, as below shown. is is the reason that I didn't use mask in the procedure of attention operation?
groundtruth: the^fragile^nature
prediction: the^fragile^fragile^fragile^fragile^fragile^fragile^fragile^fragile^fragile^fragi
The same data, when used as the validation during training, the accuracy of the test is 91.5%. After finshed training and I used the same data for inference test (the checkpoint model is same), but the accuracy was only 84.5%. Why is there a difference of 7 points. Filtering was used in both times.
Seems like the library has problems with multiprocessing on Windows.
Even using the parameter -j "1"
that should elimitate the multiprocessing, the script returns this error
Traceback (most recent call last):
File "train.py", line 232, in <module>
main_train(args)
File "train.py", line 186, in main_train
train_data = get_batch_data(train_data_list, args.train_batch_size)
File "train.py", line 51, in get_batch_data
_data = next(data)
File "C:\Users\mikyl\Desktop\SAR\data_provider\data_generator.py", line 124, in get_batch
enqueuer.start(max_queue_size=4, workers=num_workers)
File "C:\Users\mikyl\Desktop\SAR\data_provider\generator_enqueuer.py", line 78, in start
thread.start()
File "C:\Users\mikyl\AppData\Local\Programs\Python\Python36\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Users\mikyl\AppData\Local\Programs\Python\Python36\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\mikyl\AppData\Local\Programs\Python\Python36\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Users\mikyl\AppData\Local\Programs\Python\Python36\lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
reduction.dump(process_obj, to_child)
File "C:\Users\mikyl\AppData\Local\Programs\Python\Python36\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'GeneratorEnqueuer.start.<locals>.data_generator_task'
I'm working on a pull request
Hi,
executing test.py
the script stops because the following modules are missing.
from data_provider.art_loader import ArTLoader
from data_provider.syn90k_loader import Syn90KLoader
from data_provider.syntext_loader import SynTextLoader
Where I can find them?
Hi, what's the name of the node containing the predicted word?
请问你可以提供一下训练数据集的百度云链接吗?我下载不到这些数据。。。
Hi, thanks for sharing this great work. I wonder if you have tried this model on Chinese dataset? If so, did it perform well?
Did you ever get this bug when running pytorch code. When I ungrade pytorch from 1.2.0 to 1.1.0, this error happened.
Hi, I can't understand Chinese. Is there another way to download the pretrained model?
Greetings,
I noticed in your back bone implementation you used 2x1 maxpool instead of 1x2, which is mentioned in the paper. Could you explain why? Thanks!
请问是否支持中文的识别
Hi all,
I'm seeing a strange behaviour in the training. When I do the evaluation test, the result is very different from the training test.
Below an example:
Iter 17 train loss= 10.839604
################################################################################
train prediction train labels
1AAAAA HAIRANE
13 93
13 26
13A JAM
15 84
13 61
13 1970
13 293
13 127
13 70
13 DERIBA
13 854
13 2033
13 3
13A SZWARNOG
13 69
13AAA ESP
13 32
13 8
13 MOUKRIME
13 4
13 13
13AAAA FRA
11 184
11 72
13 237
15 241
13AAA YATSEVICH
13 68
13 53
15 SAW
13 20
15 2357
13 250
################################################################################
test prediction test labels
111111111111111111111111111111 354
111111111111111111111111111111 3
111111111111111111111111111111 22
111111111111111111111111111111 1103
111111111111111111111111111111 208
111111111111111111111111111111 102
111111111111111111111111111111 1213
111111111111111111111111111111 37
111111111111111111111111111111 12
111111111111111111111111111111 72
111111111111111111111111111111 F131
111111111111111111111111111111 18
111111111111111111111111111111 227
111111111111111111111111111111 2478
111111111111111111111111111111 752
111111111111111111111111111111 3
111111111111111111111111111111 14
111111111111111111111111111111 106
111111111111111111111111111111 12
111111111111111111111111111111 441
111111111111111111111111111111 11
111111111111111111111111111111 34
111111111111111111111111111111 9
111111111111111111111111111111 48
111111111111111111111111111111 54
111111111111111111111111111111 405
111111111111111111111111111111 GER
111111111111111111111111111111 21
111111111111111111111111111111 211
111111111111111111111111111111 64
111111111111111111111111111111 240
111111111111111111111111111111 7
################################################################################
Evaluation Iter 17 test loss: 252054992.000000 train accuracy: 0.010000 test accuracy 0.000000
Iter 17 save to checkpoint
Do you know why in the test prediction it is repeated the same number for all the rows?
Hello, I found a performance issue in the definition of __call__
, module/Decoder.py, tf.fill and will created repeatedly during program execution, resulting in reduced efficiency. I think it should be created before the loop in __call__
.
The same issue exists here
Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.
Hi hear,
thanks for your implementation,
I have a question, which datasets you use for pretrain model?
if i want to train with my own dataset, whether i resume with pretrain model or train from scratch with Syn90k,SynthText,SynthAdd and then fine tune with my own?
best regards
When freezing the model, the frozen graph contains the information of the training batch size.
We should somehow refactor the model to avoid this behaviour when freezing
Hello,
When I tried to freeze the graph and save as pb, I got the following error:
File "/mnt/DATA/project/xxx/SAR_TF-master/sar_model.py", line 55, in inference
input_widths_list = tf.unstack(input_widths, axis=0)
File "/data/project/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1015, in unstack
raise ValueError("Cannot infer num from shape %s" % value_shape)
ValueError: Cannot infer num from shape (?,)
I fixed the batch size=1 and the error solved:
input_train_images = tf.placeholder(dtype=tf.float32, shape=[1, args.height, args.width, 3], name="input_train_images")
input_train_images_width = tf.placeholder(dtype=tf.float32, shape=[1], name="input_train_width")
input_train_labels = tf.placeholder(dtype=tf.int32, shape=[1, args.max_len], name="input_train_labels")
input_train_labels_mask = tf.placeholder(dtype=tf.int32, shape=[1, args.max_len], name="input_train_labels_mask")
input_val_images = tf.placeholder(dtype=tf.float32, shape=[1, args.height, args.width, 3],name="input_val_images")
input_val_images_width = tf.placeholder(dtype=tf.float32, shape=[1], name="input_val_width")
input_val_labels = tf.placeholder(dtype=tf.int32, shape=[1, args.max_len], name="input_val_labels")
input_val_labels_mask = tf.placeholder(dtype=tf.int32, shape=[1, args.max_len], name="input_val_labels_mask")
Is there any way to keep the batch size as None
and save the grapb as pb? Thanks
Is there a way to reduce the size of the output model?
Hi,
I get this error when I try to start the training. Do you know how to fix it?
Traceback (most recent call last):
File "train.py", line 232, in <module>
main_train(args)
File "train.py", line 103, in main_train
batch_size=args.train_batch_size, reuse=False)
File "C:\Users\mikyl\Desktop\SAR\sar_model.py", line 40, in __call__
encoder_state, feature_map, mask_map = self.inference(input_images, input_widths, batch_size)
File "C:\Users\mikyl\Desktop\SAR\sar_model.py", line 50, in inference
input_widths = tf.cast(tf.math.floor(input_widths * (fea_W / img_W)), tf.int32)
AttributeError: module 'tensorflow.math' has no attribute 'floor'
When I train with ICDAR13 dataset with default config file, the train acc reach 1 quickly, but val acc is very low , which means overfitting .
So how can i reproduce the result on ICDAR2013?
thx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.