Running a sample project in tensor2tensor

156 views Asked by At

I am trying to execute the program on my windows pc from:

https://github.com/GoogleCloudPlatform/training-data-analyst/blob/master/courses/machine_learning/deepdive/09_sequence/poetry.ipynb

I am trying to first generate data. But this command is not working.

\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

Its giving an Error:

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

Looks problem is not getting taken. I did have the code as mentioned in the link:

same code:

@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

I have this file at ....\t2t-poetry\trainer\problem.py

Can you please let me know what I am missing.

1

There are 1 answers

0
Saurav Joshi On

The problem name has to be specified in snake_case. Convert from CamelCase to snake_case i.e PoetryLineProblem to poetry_line_problem