我一生都无法弄清楚如何从默认模型中生成文本,并输入前缀:
我已经下载了模型,这是我的代码:
import gpt_2_simple as gpt2
model_name = "124M"
sess = gpt2.start_tf_sess()
gpt2.generate(sess, model_name=model_name)
gpt2.generate(sess, model_name=model_name, prefix="<|My name is |>")
但是,当我运行它时,我收到以下错误:
tensorflow.python.framework.errors_impl.FailedPreconditionError: 2 root error(s) found. (0) Failed precondition: Attempting to use uninitialized value model/h3/mlp/c_proj/w [[{{node model/h3/mlp/c_proj/w/read}}]] [[strided_slice/_33]] (1) Failed precondition: Attempting to use uninitialized value model/h3/mlp/c_proj/w [[{{node model/h3/mlp/c_proj/w/read}}]]
知道我做错了什么吗?