Closed nikcheerla closed 7 years ago
Hello, I tried to reproduce your bug but couldn't : def buildDecoderModel(): inp = Input(batch_shape=(None,100)) decout = Dense(10)(inp) decoder = Model([inp],[decout] ) inp2 = Input(batch_shape=(None,30,100)) emb = TimeDistributed( decoder )(inp2) gru = GRU(100,return_sequences=True)(emb) gru2 = GRU(100,return_sequences=False)(gru) dec = decoder(gru2) model = Model( [inp2],[gru,dec]) model.compile( loss=["mse","mse"], optimizer="adam" ) return model
I tested with theano :
import numpy as np m= buildDecoderModel() m.fit(np.random.randn(10,30,100),[np.zeros((10,30,100)) , np.zeros((10,10)) ] )
It works fine.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, but feel free to re-open it if needed.
I'm trying to build a variational autoencoder that encodes and decodes music sequence data (of shape (50, 84)). Simultaneously, I want to predict the next element inside the music sequence (vector of shape (84,)). So I need to reuse a trainable decoder that maps from the latent space to the output space – for both encoding and next element prediction.
This is the relevant part of the code; I reuse the "decoder" model twice (in the TimeDistributed wrapper and also by itself). I keep on getting a 'this shared variable already has an update expression' error, however. When do these errors happen when reusing models, and what's the cleanest way to fix them?
Thanks!