MarcBS/multimodal_keras_wrapper

dataset.py missing import re for bpe

Closed this issue · 1 comments

I am trying to use tokenize_bpe in the nmt-keras library, which uses multimodal_keras_wrapper. The error seems to indicate that keras_wrapper's dataset.py is missing an import re statement. Would it be possible for someone to provide a fix? Thanks

Traceback (most recent call last):
  File "train_model.py", line 310, in <module>
    main()
  File "train_model.py", line 303, in main
    start_training(use_gpu)
  File "train_model.py", line 28, in start_training
    min_occ=1)
  File "/home/ntran/.local/lib/python3.6/site-packages/keras_wrapper/dataset.py", line 1302, in setOutput
    bpe_codes=bpe_codes, separator=separator, use_unk_class=use_unk_class)
  File "/home/ntran/.local/lib/python3.6/site-packages/keras_wrapper/dataset.py", line 1681, in preprocessText
    sentences[i] = tokfun(sentence)
  File "/home/ntran/.local/lib/python3.6/site-packages/keras_wrapper/dataset.py", line 2615, in tokenize_bpe
    tokenized = re.sub(u'[\n\t]+', u'', caption)
NameError: name 're' is not defined

Thanks for the catch. It's fixed now. Please, update multimodal-keras-wrapper from pip.