chemical_vae icon indicating copy to clipboard operation
chemical_vae copied to clipboard

NameError: name 'TerminalGRU' is not defined

Open ramashka328 opened this issue 4 years ago • 2 comments

Hi. I am trying to implement your model using the code line as follows:

vae = VAEUtils(directory='C:\Users\Autoencoder\chemical_vae-master\models\zinc_properties')

but however it results in the error:

~\Autoencoder\chemical_vae-master\chemvae\vae_utils.py in init(self, exp_file, encoder_file, decoder_file, directory) 55 # encoder, decoder 56 self.enc = load_encoder(self.params) ---> 57 self.dec = load_decoder(self.params) 58 self.encode, self.decode = self.enc_dec_functions() 59 self.data = None

~\Autoencoder\chemical_vae-master\chemvae\vae_utils.py in load_decoder(params) 21 def load_decoder(params): 22 if params['do_tgru']: ---> 23 return load_model(params['decoder_weights_file'], custom_objects={'TerminalGRU': TerminalGRU}) 24 else: 25 return load_model(params['decoder_weights_file'])

NameError: name 'TerminalGRU' is not defined

Could you tell me, what should I do to make it work?

ramashka328 avatar Mar 18 '20 21:03 ramashka328

Did you install it via setup.py? tgru_k2_gpu.py is the file where the TerminalGRU Layer is defined for the decoder model. Check whether vae_utils.py has from tgru_k2_gpu import TerminalGRU in it.

mkduong-ai avatar Mar 27 '20 04:03 mkduong-ai

Thank You, it worked when I installed it using setup.py.

ramashka328 avatar Mar 30 '20 09:03 ramashka328