JianshuZhang / TAP

Track, Attend and Parse for Online Handwritten Mathematical Expression Recognition
70 stars 27 forks source link

The Processing Time is so slow in GPU-Theano on Win10+CUDA10+py3.7.9 #7

Open kjhgfdsaas opened 3 years ago

kjhgfdsaas commented 3 years ago

I spend two days works on GPU-Theano environment on Win10+Cuda10. After I got this, I transfer your code from python2 to python3. But when I tried your code with 986 "online-test.pkl",it cose 43 mins in total. And in your paper, you declear it was 70s. I don't know where my mistake is.

JianshuZhang commented 3 years ago

I am not familiar with Windows environment, my environment is based on Linux. Concerning your speed is so much low, I guess you run the code on CPU, not on GPU. Maybe your GPU environment has not been successfully loaded.

2020年11月12日 下午7:00,kjhgfdsaas notifications@github.com 写道:

I spend two days works on GPU-Theano environment on Win10+Cuda10. After I got this, I transfer your code from python2 to python3. But when I tried your code with 986 "online-test.pkl",it cose 43 mins in total. And in your paper, you declear it was 70s. I don't know where my mistake is.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JianshuZhang/TAP/issues/7, or unsubscribe https://github.com/notifications/unsubscribe-auth/AETNJUKPNF4PX645VOB5UETSPO55NANCNFSM4TTEGTLA.

kjhgfdsaas commented 3 years ago

First, thanks for your reply. I think it could be. But the it's weird that CUDA performance running at 50%, the graphic crad is 2080Ti. And import theano shows "Mapped name None to device cuda: GeForce RTX 2080 Ti (0000:02:00.0)". I will double check the Theano-GPU environment. Thanks for your repository anyway.

kjhgfdsaas commented 3 years ago

@JianshuZhang

Hi,I upload some outputs in 'Decoding..', the processing time cost really weird. I'm using 'k' in 5 as default. And when building 'f_init', it says

decoder_Wyg is not in the archive decoder_byg is not in the archive decoder_Whg is not in the archive decoder_bhg is not in the archive decoder_Umg is not in the archive decoder_W_m_att is not in the archive decoder_U_when_att is not in the archive decoder_c_when_att is not in the archive ff_logit_lstm_W is not in the archive ff_logit_lstm_b is not in the archive Building f_init..

building second 'f_nect' with warning

"The file scan_perform.c is not available. This do" D:\Anaconda3\envs\theano37\lib\site-packages\theano\scan_module\scan_perform_ext.py:76: UserWarning: The file scan_perform.c is not available. This donot happen normally. You are probably in a strangesetup. This mean Theano can not use the cython code for scan. If youwant to remove this warning, use the Theano flag'cxx=' (set to an empty string) to disable all ccode generation. "The file scan_perform.c is not available. This do" D:\Anaconda3\envs\theano37\lib\site-packages\theano\scan_module\scan_perform_ext.py:76: UserWarning: The file scan_perform.c is not available. This donot happen normally. You are probably in a strangesetup. This mean Theano can not use the cython code for scan. If youwant to remove this warning, use the Theano flag'cxx=' (set to an empty string) to disable all ccode generation. "The file scan_perform.c is not available. This do" D:\Anaconda3\envs\theano37\lib\site-packages\theano\scan_module\scan_perform_ext.py:76: UserWarning: The file scan_perform.c is not available. This donot happen normally. You are probably in a strangesetup. This mean Theano can not use the cython code for scan. If youwant to remove this warning, use the Theano flag'cxx=' (set to an empty string) to disable all ccode generation. "The file scan_perform.c is not available. This do"

and the decoding part

Done Building f_next.. Done Decoding... 1 RIT_2014_97 time cost: 1 2.724409580230713 2 RIT_2014_82 time cost: 2 2.1982858180999756 3 RIT_2014_29 time cost: 3 0.12191462516784668 4 20_em_42 time cost: 4 0.09893321990966797 5 RIT_2014_156 time cost: 5 2.206120014190674 6 RIT_2014_112 time cost: 6 0.1179203987121582 7 RIT_2014_292 time cost: 7 2.1617562770843506 8 RIT_2014_305 time cost: 8 2.208272933959961 9 RIT_2014_9 time cost: 9 1.8614346981048584 10 RIT_2014_57 time cost: 10 0.2438359260559082 11 RIT_2014_233 time cost: 11 2.184873104095459 12 RIT_2014_95 time cost: 12 1.8142964839935303 13 RIT_2014_154 time cost: 13 2.067622661590576 14 RIT_2014_272 time cost: 14 0.24083733558654785 15 RIT_2014_249 time cost: 15 2.055562734603882 16 RIT_2014_99 time cost: 16 2.042739152908325 17 RIT_2014_299 time cost: 17 1.7139482498168945 18 RIT_2014_89 time cost: 18 1.7507421970367432 19 RIT_2014_298 time cost: 19 1.7246899604797363 20 502_em_12 time cost: 20 2.03169322013855

My cuda is running in 50%, but GPU memory takes only 500M,really werid. Do you have some configs for GPU memory restiction? Thanks a lot

JianshuZhang commented 3 years ago

I may find the reason, the model you loaded is not consistent with the code, it’s my fault, may be I have changed the code or model sometime I forgot. Please try retraining a new model using training codes, then testing the new model using testing code.

2020年11月13日 下午3:08,kjhgfdsaas notifications@github.com 写道:

@JianshuZhang https://github.com/JianshuZhang Hi,I upload some outputs in 'Decoding..', the processing time cost really weird. I'm using 'k' in 5 as default. And when building 'f_init', it says

decoder_Wyg is not in the archive decoder_byg is not in the archive decoder_Whg is not in the archive decoder_bhg is not in the archive decoder_Umg is not in the archive decoder_W_m_att is not in the archive decoder_U_when_att is not in the archive decoder_c_when_att is not in the archive ff_logit_lstm_W is not in the archive ff_logit_lstm_b is not in the archive Building f_init..

building second 'f_nect' with warning

"The file scan_perform.c is not available. This do" D:\Anaconda3\envs\theano37\lib\site-packages\theano\scan_module\scan_perform_ext.py:76: UserWarning: The file scan_perform.c is not available. This donot happen normally. You are probably in a strangesetup. This mean Theano can not use the cython code for scan. If youwant to remove this warning, use the Theano flag'cxx=' (set to an empty string) to disable all ccode generation. "The file scan_perform.c is not available. This do" D:\Anaconda3\envs\theano37\lib\site-packages\theano\scan_module\scan_perform_ext.py:76: UserWarning: The file scan_perform.c is not available. This donot happen normally. You are probably in a strangesetup. This mean Theano can not use the cython code for scan. If youwant to remove this warning, use the Theano flag'cxx=' (set to an empty string) to disable all ccode generation. "The file scan_perform.c is not available. This do" D:\Anaconda3\envs\theano37\lib\site-packages\theano\scan_module\scan_perform_ext.py:76: UserWarning: The file scan_perform.c is not available. This donot happen normally. You are probably in a strangesetup. This mean Theano can not use the cython code for scan. If youwant to remove this warning, use the Theano flag'cxx=' (set to an empty string) to disable all ccode generation. "The file scan_perform.c is not available. This do"

and the decoding part

Done Building f_next.. Done Decoding... 1 RIT_2014_97 time cost: 1 2.724409580230713 2 RIT_2014_82 time cost: 2 2.1982858180999756 3 RIT_2014_29 time cost: 3 0.12191462516784668 4 20_em_42 time cost: 4 0.09893321990966797 5 RIT_2014_156 time cost: 5 2.206120014190674 6 RIT_2014_112 time cost: 6 0.1179203987121582 7 RIT_2014_292 time cost: 7 2.1617562770843506 8 RIT_2014_305 time cost: 8 2.208272933959961 9 RIT_2014_9 time cost: 9 1.8614346981048584 10 RIT_2014_57 time cost: 10 0.2438359260559082 11 RIT_2014_233 time cost: 11 2.184873104095459 12 RIT_2014_95 time cost: 12 1.8142964839935303 13 RIT_2014_154 time cost: 13 2.067622661590576 14 RIT_2014_272 time cost: 14 0.24083733558654785 15 RIT_2014_249 time cost: 15 2.055562734603882 16 RIT_2014_99 time cost: 16 2.042739152908325 17 RIT_2014_299 time cost: 17 1.7139482498168945 18 RIT_2014_89 time cost: 18 1.7507421970367432 19 RIT_2014_298 time cost: 19 1.7246899604797363 20 502_em_12 time cost: 20 2.03169322013855

My cuda is running in 50%, but GPU memory takes only 500M,really werid. Do you have some configs for GPU memory restiction? Thanks a lot

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JianshuZhang/TAP/issues/7#issuecomment-726566249, or unsubscribe https://github.com/notifications/unsubscribe-auth/AETNJUNFQX2RH6RKD7CQ5KDSPTLOHANCNFSM4TTEGTLA.

kjhgfdsaas commented 3 years ago

@JianshuZhang Thanks for your reply, I'm trying to retrain the model

kjhgfdsaas commented 3 years ago

@JianshuZhang in your nmt.py line 20, from optimizers import adadelta, adadelta_weightnoise, adam, adam_weightnoise, sgd_momentum, rmsprop but I didn't find function 'adam_weightnoise','sgd_momentum'. So I remove them. Is that good for training?

JianshuZhang commented 3 years ago

You can just remove ‘adam_weightnoise’ and ’sgd_momentum’, in my experiments, all we need are ‘adadelta’ and ‘adadelta_weightnoise'

2020年11月13日 下午4:36,kjhgfdsaas notifications@github.com 写道:

@JianshuZhang https://github.com/JianshuZhang in your nmt.py line 20, from optimizers import adadelta, adadelta_weightnoise, adam, adam_weightnoise, sgd_momentum, rmsprop but I didn't find function 'adam_weightnoise','sgd_momentum'.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JianshuZhang/TAP/issues/7#issuecomment-726605779, or unsubscribe https://github.com/notifications/unsubscribe-auth/AETNJUN5JYBMS76WQCMO3STSPTVW3ANCNFSM4TTEGTLA.

kjhgfdsaas commented 3 years ago

@JianshuZhang Thank you anyway. But I have to give up to study your repository. First, the code is python2 that really difficult to transfer all of them to python3 in train part. And then I think I can't transfer your code to tensorflow framework helps my research. Thanks a lot