Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intro_to_chemvae.ipynb loading model AttributeError: 'str' object has no attribute 'decode' #39

Open
Rdk0 opened this issue May 9, 2021 · 3 comments

Comments

@Rdk0
Copy link

Rdk0 commented May 9, 2021

executing vae = VAEUtils(directory='../models/zinc_properties')
yields this error


AttributeError Traceback (most recent call last)
in ()
----> 1 vae = VAEUtils(directory='../models/zinc_properties')

/home/rad/miniconda3/envs/chemvae/lib/python3.6/site-packages/chemvae-1.0.0-py3.6.egg/chemvae/vae_utils.py in init(self, exp_file, encoder_file, decoder_file, directory)
35 self.indices_char = dict((i, c) for i, c in enumerate(chars))
36 # encoder, decoder
---> 37 self.enc = load_encoder(self.params)
38 self.dec = load_decoder(self.params)
39 self.encode, self.decode = self.enc_dec_functions()

/home/rad/miniconda3/envs/chemvae/lib/python3.6/site-packages/chemvae-1.0.0-py3.6.egg/chemvae/models.py in load_encoder(params)
77 # return encoder
78 # !# not sure if this is the right format
---> 79 return load_model(params['encoder_weights_file'])
80
81

/home/rad/miniconda3/envs/chemvae/lib/python3.6/site-packages/keras/models.py in load_model(filepath, custom_objects, compile)
230 if model_config is None:
231 raise ValueError('No model found in config file.')
--> 232 model_config = json.loads(model_config.decode('utf-8'))
233 model = model_from_config(model_config, custom_objects=custom_objects)
234

AttributeError: 'str' object has no attribute 'decode'

@sspleo
Copy link

sspleo commented May 11, 2021

This issue has someething to do with h5py. Downgrade h5py to '2.10.0' or remove '.decode('utf-8')' from load_model.

@Shredderroy
Copy link

I experience the same issue as well.

@Shredderroy
Copy link

I can confirm that changing h5py to h5py=2.10.0 in environment.yml makes the error go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants