bojone / SPACES

端到端的长本文摘要模型(法研杯2020司法摘要赛道)
386 stars 91 forks source link

AttributeError与FileNotFoundError #26

Open holy816 opened 3 years ago

holy816 commented 3 years ago

苏神你好,我在windows下跑您的SPACES,然后遇到了两个问题。 (1) Traceback (most recent call last): File "seq2seq_convert.py", line 6, in from extract_model import File "E:\git\SPACES\extract_model.py", line 190, in model.load_weights('weights/extract_model.%s.weights' % fold) File "C:\Users\clab320.conda\envs\spaces\lib\site-packages\keras\engine\saving.py", line 492, in load_wrapper return load_function(args, **kwargs) File "C:\Users\clab320.conda\envs\spaces\lib\site-packages\keras\engine\network.py", line 1230, in load_weights f, self.layers, reshape=reshape) File "C:\Users\clab320.conda\envs\spaces\lib\site-packages\keras\engine\saving.py", line 1183, in load_weights_from_hdf5_group original_keras_version = f.attrs['keras_version'].decode('utf8') AttributeError: 'str' object has no attribute 'decode' 这个问题百度后说是因为一般是因为str的类型本身不是bytes,所以不能解码 但是我看saving.py中有很多这样格式的语句,所以想请苏神解答一下

(2) Traceback (most recent call last): File "seq2seq_model.py", line 304, in data = load_data(data_seq2seq_json) File "seq2seq_model.py", line 41, in load_data with open(filename) as f: File "C:\Users\clab320.conda\envs\spaces\lib\site-packages\bert4keras\snippets.py", line 92, in init self.file = open(name, mode, encoding=encoding, errors=errors) FileNotFoundError: [Errno 2] No such file or directory: '/git/SPACES/datasets/train_seq2seq.json' 这个问题是根本就没有train_seq2seq.json这个文件

希望苏神可以解答一下,谢谢苏神

beybin commented 2 years ago

问题1:pip install h5py==2.10