nlp - 在 tensor2tensor 中运行示例项目
问题描述
我正在尝试从以下位置在我的 Windows 电脑上执行该程序:
我正在尝试首先生成数据。但是这个命令不起作用。
\Anaconda3\Scripts> python .\t2t-datagen --t2t_usr_dir=C:\Users\NLP\t2t-poetry --problem=PoetryLineProblem --data_dir=.\t2t_data --tmp-dir=C:\Userst2t-poetry\tmp
它给出一个错误:
Anaconda3\lib\site-packages\tensor2tensor\bin\t2t_datagen.py", line 196, in main
raise ValueError(error_msg)
ValueError: You must specify one of the supported problems to generate data for:
* algorithmic_addition_binary40
* algorithmic_addition_decimal40
看起来问题没有得到解决。我确实有链接中提到的代码:
相同的代码:
@registry.register_problem
class PoetryLineProblem(text_problems.Text2TextProblem):
"""Predict next line of poetry from the last line. From Gutenberg texts."""
@property
def approx_vocab_size(self):
return 2**13 # ~8k
我在 ....\t2t-poetry\trainer\problem.py 有这个文件
你能告诉我我错过了什么吗?
解决方案
问题名称必须在snake_case 中指定。从CamelCase 转换为snake_case 即PoetryLineProblem 到poetry_line_problem
推荐阅读
- ios - 图像未在 SwiftUI TabView 中调整大小
- dialogflow-es - 在 Dialogflow 中无需用户输入即可触发下一个意图
- karate - 如何在空手道框架中使用 for 循环登录
- c# - 将xml序列化为c#对象
- mysql - 分层数据库结构的问题
- python - 删除包含文档的数据框中的页眉、页脚和引号
- java - 如何从 Bean 定义中访问 Bean Id
- macos - 如何使 objdump 从 macOS Catalina 上的指定起始地址反汇编?
- android - PanResponder 组件中的 ScrollView
- c# - C# 设置/创建 DateTaken 参数