Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError与FileNotFoundError #26

Open
holy816 opened this issue Sep 24, 2021 · 1 comment
Open

AttributeError与FileNotFoundError #26

holy816 opened this issue Sep 24, 2021 · 1 comment

Comments

@holy816
Copy link

holy816 commented Sep 24, 2021

苏神你好,我在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
Copy link

beybin commented Nov 17, 2021

问题1:pip install h5py==2.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants