Open gabrielmontagne opened 7 years ago
I ran into a similar error but TF complained about a different, more interpretable issue:
InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [512,53] rhs shape= [200,53]
[[Node: save/Assign_7 = Assign[T=DT_FLOAT, _class=["loc:@prediction/W"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/cpu:0"](prediction/W/Adam_1, save/RestoreV2_7)]]
When I changed n_cells from 512 to 200, the error went away, but I started getting mostly garbage output again.
Ah, I forgot to make the "os.path.exists(ckpt_name + '.index')" fix at inference time. If I add that after initialization I'm seeing reasonable output (well, as reasonable as one can expect in this case).
Is this working now then or is there still some issue?
It works for me with the following changes (but doesn't work as-is):
New model provided in https://github.com/pkmital/CADL/commit/5ef9564478d8facf7ffcc82144c9652b058850a7
Sorry this is still half an issue: the new model is compatible, but in infer
, the code which checks if the model exists is not working and should use e.g. latest_checkpoint or remove the check entirely, or else the model is not loaded.
On Session 5, part 2, the check
... does not match the provided checkpoint file name exactly
trump.ckpt.data-00000-of-00001
so the load is not attempted. Therefore, the model is untrained for the example and the predictions are all non-deterministic random strings,etc.
If the check is removed, then the
saver
does pick up the provided model, but then cannot load it. It blows up with the error below. I've also noticed, while chasing this, that theencoder
anddecoder
used for this part of the exercise are actually initialized with a different text -- the one from Part 4 - Character-Level Language Model; I guess that's fine as the sets are probably equivalent in this case, but wouldn't it be better to add a cell just to regenerate these for the latter section?I'm running TF 1.1.0 wit GPU support on a Debian 4.9.18-1 laptop.