Skip to content
Advertisement

During creating VAE model throws exception “you should implement a `call` method.”

I want to create VAE(variational autoencoder). During model creating it throws exception. When subclassing the Model class, you should implement a call method.

I am using Tensorflow 2.0

JavaScript

Models with names

JavaScript

I want to get model.

Advertisement

Answer

The problem is here:

JavaScript

You are passing three arguments to the construction, where only two are needed (inputs and outputs). Models do not have names. The problem is that three parameters will break the detection of network or sub-classed model as shown in the keras source code.

So just replace the code with:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement