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

README Tutorial fails #296

Open
mrx23dot opened this issue May 24, 2022 · 1 comment
Open

README Tutorial fails #296

mrx23dot opened this issue May 24, 2022 · 1 comment

Comments

@mrx23dot
Copy link

mrx23dot commented May 24, 2022

I followed the readme.md tutorial.
Done the fine tuning.
It created \checkpoint\run1\ directory.

But when I run the 2nd part (standalone generate, from same dir I ran fine tuning from) it fails:

import gpt_2_simple as gpt2
sess = gpt2.start_tf_sess()
gpt2.load_gpt2(sess)
gpt2.generate(sess)

λ python generate.py
checkpoint_path checkpoint\run1
ckpt None
2022-05-24 10:59:28.937419: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:354] MLIR V1 optimization pass is not enabled
Loading checkpoint None
Traceback (most recent call last):
  File "generate.py", line 8, in <module>
    gpt2.load_gpt2(sess)
  File "C:\Python37\lib\site-packages\gpt_2_simple\gpt_2.py", line 410, in load_gpt2
    saver.restore(sess, ckpt)
  File "C:\Python37\lib\site-packages\tensorflow\python\training\saver.py", line 1405, in restore
    raise ValueError("Can't load save_path when it is None.")
ValueError: Can't load save_path when it is None.

if I specify checkpoint:

gpt2.load_gpt2(sess, checkpoint='run1')
checkpoint_path checkpoint\run1
ckpt checkpoint\run1\run1
ValueError: The passed save_path is not a valid checkpoint: checkpoint\run1\run1

So I guess it expects an empty string:

Detected at node 'save/RestoreV2' defined at (most recent call last):
    File "generate.py", line 8, in <module>
      gpt2.load_gpt2(sess, checkpoint='')
    File "C:\Python37\lib\site-packages\gpt_2_simple\gpt_2.py", line 403, in load_gpt2
      saver = tf.compat.v1.train.Saver(allow_empty=True)
Node: 'save/RestoreV2'
Unable to open table file checkpoint\run1\: NOT_FOUND: NewRandomAccessFile failed to Create/Open: checkpoint\run1\ : The system cannot find the path specified.
; No such process
         [[{{node save/RestoreV2}}]]

So it defensively fails out of the box.
It did seem to generate some sample text during the fine tuning, but not in standalone generation.

@shizhediao
Copy link

same question

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