google-deepmind / neural-processes

This repository contains notebook implementations of the following Neural Process variants: Conditional Neural Processes (CNPs), Neural Processes (NPs), Attentive Neural Processes (ANPs).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reuse error

Spider-scnu opened this issue · comments

commented

When I run the 'attentive_neural_process.ipynb', I got the mistakes as follows:

ValueError: Variable layer_3/kernel already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:

File "", line 28, in batch_mlp
output, output_sizes[-1], name="layer_{}".format(i + 1))
File "", line 31, in call
hidden = batch_mlp(encoder_input, self._output_sizes, "latent_encoder")
File "", line 58, in call
prior = self._latent_encoder(context_x, context_y)

This may have happened because you haven't reset the TF computation graph.
Try running tf.reset_default_graph() then re-running the code.