The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

263325 (1) [Avatar] Offline
#1
Hello,

When trying to load variables (listing 2.11) I keep getting "Key spikes_1 not found in checkpoint" error.

NotFoundError: Key spikes_1 not found in checkpoint
[[Node: save_5/RestoreV2_1 = RestoreV2[dtypes=[DT_BOOL], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save_5/Const_0_0, save_5/RestoreV2_1/tensor_names, save_5/RestoreV2_1/shape_and_slices)]]


I'm pretty sure the checkpoint is created properly, though. I'm using TF 1.4, could it be an incompatibility issue? (I've also tried the updated code for TF 1.0 from GitHub, it didn't work either).

Thanks a lot for your help!
Kim Falk (25) [Avatar] Offline
#2
I had copied all of the chapter 2 code into one Jupyter notebook, and ran into the same problem when running the code.

I solved the problem by calling

>tf.reset_default_graph()

before running the code in the listings 2.10 and 2.11.

The reason why the code work actually works as in the book is that each of the listings is in a separate notebook. So the tf is freshly initialized before every listing.