duterscmy / ccks2019-ckbqa-4th-codes

中文知识库问答代码,CCKS2019 CKBQA评测第四名解决方案
476 stars 91 forks source link

您好,想问下similarity.py的tf版本和protobuf的版本应该是多少?很多属性值都失效了。 #51

Open pen-ho opened 3 years ago

pen-ho commented 3 years ago

参考连接和这个库也没有看到requirement的说明

AttributeError: 'google.protobuf.pyext._message.FieldProperty' object has no attribute 'allow_growth'

AttributeError: 'google.protobuf.pyext._message.FieldProperty' object has no attribute 'per_process_gpu_memory_fraction'

HankTown commented 3 years ago

我的protobuf没有版本错误,我的版本是3.14.0 tf版本好像用1.1.1可以不报错,但是我用的2.3,只需要把报错的属性值改为2.x版本的写法就可以了。

pen-ho commented 3 years ago

我的protobuf没有版本错误,我的版本是3.14.0 tf版本好像用1.1.1可以不报错,但是我用的2.3,只需要把报错的属性值改为2.x版本的写法就可以了。

我后来参考bert做相似度那个链接,看到里面有issues说安装tf 版本为1.12.0,后来这么说也没报错了。

duterscmy commented 3 years ago

similarity.py是fork这个项目里的 https://github.com/terrifyzhao/bert-utils 印象里是比较低版本的tf.1.x了

georgewangchn commented 3 years ago

tensorflow-gpu==1.15.0 thulac==0.2.1 neo4j==4.2.1 h5py==2.10.0 numpy==1.19.5 keras_bert==0.50.0 joblib==1.0.1 six==1.15.0 Keras==2.2.4 jieba==0.42.1 gensim==3.8.3 termcolor==1.1.0 pandas==1.1.5 scikit_learn==0.24.1 tqdm==4.59.0

lijing0224 commented 3 years ago

我的protobuf没有版本错误,我的版本是3.14.0 tf版本好像用1.1.1可以不报错,但是我用的2.3,只需要把报错的属性值改为2.x版本的写法就可以了。

你好,我想问tf.contrib.map_and_batch这个方法怎么改成2.x版本的,在similarity.py中579行 d = d.apply( tf.contrib.map_and_batch( lambda record: _decode_record(record, name_to_features), batch_size=batch_size, drop_remainder=drop_remainder))