Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ModuleNotFoundError: No module named '_regex' #15

Open
fabrahman opened this issue Jan 10, 2020 · 0 comments
Open

ModuleNotFoundError: No module named '_regex' #15

fabrahman opened this issue Jan 10, 2020 · 0 comments

Comments

@fabrahman
Copy link

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant