Skip to content

[Question] how to save the analyzer object for later online use. #304

@ShaiBiton

Description

@ShaiBiton

Hi guys,

I love this package and started to use it again after you moved to tf2 (also used it when it was in its tf1 days).
So thanks for all the hard work !)

My question is, I'm trying to save the analyzer after generated for future use but I seem to unable to do it.
neither pickling/dill helped or even save the tf2 model itself.
the generation can take some time and in order to use it as an online feature I have to find a workaround.

from what I've got so far, I cant pickle/dill the object because its using TF infra (which has parts written in C), and I can save the generated model (analyzer_obj._analyzer_model) because the eager execution is disabled (apparently its important..)

anything you guys can contribute from your experience?

P.S
the only solution I see is to use full on TF2 and remove the line (tf.compat.v1.disable_eager_execution()) and use tf.GradientTape.
I tried to do it but it has issues with the session that add difficulty to this.

Thanks !!)
Shai

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions