Giter Club home page Giter Club logo

Comments (3)

Chm-vinicius avatar Chm-vinicius commented on May 1, 2024

For simplify the bug reprodution follow the code where the inputs is two simple dict of tensors and one int tensor.
This code do the same as issue code and reproduce the error.

@tf.keras.saving.register_keras_serializable(package="MyLayers")

class BruteForce3(tf.keras.layers.Layer):

  def __init__(self, model, k=5, **kwargs):
      super().__init__(**kwargs)
      self.model = model
      self.k = k

  @tf.function(input_signature=[data_ds.element_spec, candidaster.element_spec, tf.TensorSpec([], dtype=tf.int32)])
  # @tf.function
  def call(self, queries, candidates, ks):
      
      standard_brute = tfrs.layers.factorized_top_k.BruteForce(self.model.query_model)
      
      candidates = [candidates]
      
      parse_one = pd.DataFrame.from_dict(candidates).to_dict(orient='list')
      candidates = tf.data.Dataset.from_tensor_slices(parse_one)
      
      standard_brute.index_from_dataset(tf.data.Dataset.zip(candidates.batch(2).map(lambda x: x['experience.jobTitle']), 
                                         candidates.batch(2).map(self.model.candidate_model)
                                        ))
      scores, ids = standard_brute(queries, ks)
      
      return scores, ids`

and save model:

`custom = BruteForce3(final_model)

for l in data_ds.take(1):
    scores, jobs = custom(l, cand[0], 2)
    
    print(scores, jobs)
    
    tf.saved_model.save(custom, "./serveModels/exportedMode36")`

when i save the model without function decorator and inputs_signatures i have the follow error on calling loaded model:
ValueError: Found zero restored functions for caller function.
and if i serve with tensorflow serving i have the follow response from server endpoint:
"error": "Serving signature name: \"serving_default\" not found in signature def"

from tensorflow.

SuryanarayanaY avatar SuryanarayanaY commented on May 1, 2024

Hi @Chm-vinicius ,

Could you please minimal code snippet for reproducing the issue? Thanks!

It seems the code contains tensorflow recommender layers which we are not supporting here at TF repo. I can see this is already reported in concerned repo.

If you can able to reproduce the issue with TF/Keras please submit the code snippet for same. Thanks!

from tensorflow.

Chm-vinicius avatar Chm-vinicius commented on May 1, 2024

Hi @SuryanarayanaY,

Thanks for your response!
Unfortunately due to NDA contract i cant share more than that, also we still in permantly contact with a google engineers to find and solve this issue.
When the solution are reached i certainly share her.

from tensorflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.