We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
改成python3需要更改三个地方才能跑起来. 1. np.random.shuffle(sents) # 打乱语料,以便后面划分验证集 sents = sents[0] chars = {} # 统计字表 def max_in_dict(d): # 定义一个求字典中最大值的函数 key, value = list(d.items())[0] for i, j in list(d.items())[1:]: if j > value: key, value = i, j return key, value 卡在那不动,是生成器的时候,遍历数据的时候,数据为空,所以需要sents = sents[0], 后面两处是验证的时候需要更改的. 我测试环境是Python3.6+tensorflow1.14/tensorflow2.1
改成python3需要更改三个地方才能跑起来. 1.
np.random.shuffle(sents) # 打乱语料,以便后面划分验证集 sents = sents[0] chars = {} # 统计字表
def max_in_dict(d): # 定义一个求字典中最大值的函数 key, value = list(d.items())[0] for i, j in list(d.items())[1:]: if j > value: key, value = i, j return key, value
卡在那不动,是生成器的时候,遍历数据的时候,数据为空,所以需要sents = sents[0], 后面两处是验证的时候需要更改的. 我测试环境是Python3.6+tensorflow1.14/tensorflow2.1
其实把split('\r\n')改成split('\n')就可以了
Originally posted by @liujingqiao in #5 (comment)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
其实把split('\r\n')改成split('\n')就可以了
Originally posted by @liujingqiao in #5 (comment)
The text was updated successfully, but these errors were encountered: