Transformer icon indicating copy to clipboard operation
Transformer copied to clipboard

ModuleNotFoundError: No module named '_regex'

Open fabrahman opened this issue 5 years ago • 0 comments

Hi,

I have been using this transformer implementation for so long and everything worked well. I have some trained model (saved in checkpoint) but now, after some time when I try to load the checkpoints for generation, I got this error which is rooted from dill package:

loading spacy tokenizers...
Traceback (most recent call last):
  File "translate_file.py", line 148, in <module>
    main()
  File "translate_file.py", line 118, in main
    fields = create_fields(opt)
  File "/home/composition_func/Process.py", line 75, in create_fields
    SRC = pickle.load(open(f'{opt.load_weights}/SRC.pkl', 'rb'))
  File "/home/anaconda3/envs/py36/lib/python3.7/site-packages/dill/_dill.py", line 270, in load
    return Unpickler(file, ignore=ignore, **kwds).load()
  File "/home/anaconda3/envs/py36/lib/python3.7/site-packages/dill/_dill.py", line 472, in load
    obj = StockUnpickler.load(self)
  File "/home/anaconda3/envs/py36/lib/python3.7/site-packages/dill/_dill.py", line 826, in _import_module
    return __import__(import_name)
ModuleNotFoundError: No module named '_regex'

I have regex installed and dill version is 0.3.1.1 I guess my previous dill version maybe was sth else. But I cannot solve this error. I cannot load my trained model at all. Do you have any idea? Thanks.

fabrahman avatar Jan 10 '20 23:01 fabrahman