chemical_vae
chemical_vae copied to clipboard
NameError: name 'TerminalGRU' is not defined
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?
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.
Thank You, it worked when I installed it using setup.py.