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

Tensorflow warnings when using encode #56

Open
peetceenatoo opened this issue May 17, 2023 · 5 comments
Open

Tensorflow warnings when using encode #56

peetceenatoo opened this issue May 17, 2023 · 5 comments
Assignees
Labels
dependencies Pull requests related to dependencies

Comments

@peetceenatoo
Copy link

with load_model_from_directory(model_dir) as model:
embeddings = model.encode(smiles)

"WARNING:tensorflow:From ****\tensorflow\python\util\deprecation.py:576: calling function (from tensorflow.python.eager.polymorphic_function.polymorphic_function) with experimental_relax_shapes is deprecated and will be removed in a future version.
Instructions for updating:
experimental_relax_shapes is deprecated, use reduce_retracing instead"

and

"WARNING:tensorflow:Please fix your imports. Module tensorflow.python.training.tracking.data_structures has been moved to tensorflow.python.trackable.data_structures. The old module will be deleted in version 2.11."

I would like my scripts to not just stop working one day.

@kmaziarz kmaziarz changed the title Warnings using encode(smiles) Tensorflow warnings when using encode May 18, 2023
@kmaziarz kmaziarz self-assigned this May 18, 2023
@kmaziarz kmaziarz added the dependencies Pull requests related to dependencies label May 18, 2023
@kmaziarz
Copy link
Collaborator

I'll take a look. I think some of these originate in tf2_gnn, so it will take a while to update it there and then propagate the new version here. That being said, using tensorflow earlier than 2.11 for now sounds reasonable and not overly restrictive, as 2.11 is relatively recent.

@kmaziarz
Copy link
Collaborator

kmaziarz commented Jul 12, 2023

Interestingly, I checked locally under 2.12.1, and while the deprecation warning regarding python.training.tracking.data_structures is there, the import still works. So the message is perhaps not entirely accurate.

@kmaziarz
Copy link
Collaborator

The deprecation warning related to python.training.tracking.data_structures should now avoided through microsoft/tf2-gnn#61 (soon to be released on PyPI as 2.14.0).

@shriyamr
Copy link

While using the encode and decode methods of the wrapper class, I often get the error 'VaeWrapper' object has no attribute '_inference_server'. Is there some way to fix this?

@kmaziarz
Copy link
Collaborator

While using the encode and decode methods of the wrapper class, I often get the error 'VaeWrapper' object has no attribute '_inference_server'. Is there some way to fix this?

Are you loading the model as a context manager (as explained in the README) and only using the model inside of the context?

with load_model_from_directory(model_dir) as model:
   pass # Use the model inside

# Do not use the model outside

The with block signals to the model that it should spawn parallel processes for encoding/decoding; exiting the block signals that the processes can be cleaned up. This is why you should not load the model without with (e.g. model = load_model_from_directory(model_dir)), as that would give you a model that has not been fully initialized, which would cause the error you mentioned. Alternatively, the same error would arise if one was to use the model after exiting the with block, at which point the processes have been killed and the inference server has been deleted.

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

No branches or pull requests

3 participants