yanshao9798 / tagger

A Joint Chinese segmentation and POS tagger based on bidirectional GRU-CRF
151 stars 44 forks source link

integer division or modulo by zero #10

Closed GabrielLin closed 6 years ago

GabrielLin commented 6 years ago

I trained the model with Ensemble

python tagger.py train -p ud1 -t train.txt -d dev.txt -wv -cp -rd -gru -m model_ud1_1 -emb Embeddings/glove.txt

python tagger.py train -p ud1 -t train.txt -d dev.txt -wv -cp -rd -gru -m model_ud1_2 -emb Embeddings/glove.txt

python tagger.py train -p ud1 -t train.txt -d dev.txt -wv -cp -rd -gru -m model_ud1_3 -emb Embeddings/glove.txt

python tagger.py train -p ud1 -t train.txt -d dev.txt -wv -cp -rd -gru -m model_ud1_4 -emb Embeddings/glove.txt

All training steps are OK.

But when I ran python tagger.py test -ens -p ud1 -e test.txt -m model_ud1 -emb Embeddings/glove.txt

It shew the following error:

Traceback (most recent call last): File "tagger.py", line 505, in large_file=args.tag_large) File "/data1/myname/nlp/tagger/bucket_model.py", line 597, in tag pt_h=pt_holder, pt=self.pixels, ensemble=ensemble, batch_size=real_batch) File "/data1/myname/nlp/tagger/bucket_model.py", line 615, in predict verbose=verbose) File "/data1/myname/nlp/tagger/batch.py", line 61, in predict trans.append(en_trans/en_num) ZeroDivisionError: integer division or modulo by zero

I trained the Single model and I found that the Ensemble model are located in the same folder. Is it this reason?

yanshao9798 commented 6 years ago

It is another problem on old vs new TensorFlows. It is fixed now. Sorry about that.