运行ernie_encoder.py报错TypeError: write() argument must be str, not bytes
Created by: xcxxdy
原始配置,原始数据,未做任何修改。命令行输出如下: ----------- Configuration Arguments ----------- batch_size: 32 data_set: ../task_data/lcqmc/dev.tsv do_lower_case: True ernie_config_path: config/ernie_config.json init_pretraining_params: ../model/params max_seq_len: 128 output_dir: ./test use_cuda: False vocab_path: config/vocab.txt
attention_probs_dropout_prob: 0.1 hidden_act: relu hidden_dropout_prob: 0.1 hidden_size: 768 initializer_range: 0.02 max_position_embeddings: 513 num_attention_heads: 12 num_hidden_layers: 12 type_vocab_size: 2 vocab_size: 18000
Device count: 40 Total num examples: 8802 Load pretraining parameters from ../model/params. Traceback (most recent call last): File "ernie_encoder.py", line 182, in main(args) File "ernie_encoder.py", line 172, in main np.save(cls_emb_file, total_cls_emb) File "/home/tjmu/anaconda3/lib/python3.6/site-packages/numpy/lib/npyio.py", line 511, in save pickle_kwargs=pickle_kwargs) File "/home/tjmu/anaconda3/lib/python3.6/site-packages/numpy/lib/format.py", line 565, in write_array version) File "/home/tjmu/anaconda3/lib/python3.6/site-packages/numpy/lib/format.py", line 335, in _write_array_header fp.write(header_prefix) TypeError: write() argument must be str, not bytes