lonePatient / BERT-chinese-text-classification-pytorch

This repo contains a PyTorch implementation of a pretrained BERT model for text classification.
99 stars 19 forks source link

import error #3

Closed zhaowujie closed 5 years ago

zhaowujie commented 5 years ago

Connected to pydev debugger (build 182.4505.26) Traceback (most recent call last): File "/media/hp208/4t/soft/pycharm-community-2018.2.4/helpers/pydev/pydevd.py", line 1664, in <module> main() File "/media/hp208/4t/soft/pycharm-community-2018.2.4/helpers/pydev/pydevd.py", line 1658, in main globals = debugger.run(setup['file'], None, None, is_module) File "/media/hp208/4t/soft/pycharm-community-2018.2.4/helpers/pydev/pydevd.py", line 1068, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/media/hp208/4t/soft/pycharm-community-2018.2.4/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/media/hp208/4t/zhaoxingjie/text/BERT-chinese-text-classification-pytorch/train_bert.py", line 16, in <module> from pybert.model.nn.bert_fine import BertFine File "/media/hp208/4t/zhaoxingjie/text/BERT-chinese-text-classification-pytorch/pybert/model/nn/bert_fine.py", line 3, in <module> from pytorch_pretrained_bert.modeling import PreTrainedBertModel, BertModel ImportError: cannot import name 'PreTrainedBertModel' when I run train_bert.py, something wrong like this....

zhaowujie commented 5 years ago

use BertPreTrainedModel to repalce PreTrainedBertModel is ok