Code Monkey home page Code Monkey logo

Comments (7)

mdreves avatar mdreves commented on August 15, 2024

Can you provide example outputs for the labels and predictions.

from model-analysis.

albertnanda avatar albertnanda commented on August 15, 2024
model = tf.saved_model.load(export_dir='/tmp/tfx-interactive-model/6/serving_model_dir/')
predict_fn = model.signatures["serving_default"]
text = "some random text"
example = tf.train.Example(features = tf.train.Features(feature ={
    "Headline":_string_feature('headline'),
    "InternalId":_int64_feature(1111),
    "Text":_string_feature(text),
    "content_id":_string_feature("2222"),
}))
serialized_example = example.SerializeToString()
predict_fn(tf.constant([serialized_example]))

{'outputs': <tf.Tensor: shape=(1, 10), dtype=float32, numpy=
 array([[0.6034294 , 0.40879828, 0.4462878 , 0.3196895 , 0.31108657,
         0.30687535, 0.27371922, 0.29507416, 0.2872882 , 0.26999897]],
       dtype=float32)>}

This is because I have 10 classes, so probability for all the 10 classes.

from model-analysis.

mdreves avatar mdreves commented on August 15, 2024

The categories labels you mentioned above only has 5 classes. These need to align.

from model-analysis.

albertnanda avatar albertnanda commented on August 15, 2024

@mdreves No, that's was an earlier iteration, I have 10 classes. The format remains the same, but now I have 10 classes.

{
 'Text': array([b'Football fans looking forward to seeing the renewal of the rivalry between Cristiano Ronaldo and Lionel Messi were made to wait a while longer after the Portuguese forward was forced to miss Juventus' Champions League tie against Barcelona on Wednesday.'],dtype=object),
 'Headline': array([b"Lionel Messi scores as Cristiano Ronaldo misses Barcelona's victory over Juventus."], dtype=object),
 'categories': array([1., 0., 0., 0., 0., 0., 0., 0., 0.,0.], dtype=object), 
}

{
 'Text_xf': array([b'COVID-19 has changed fan behavior and accelerated three to five years of technology adoption into six months'],dtype=object),
 'Headline_xf': array([b"How Technology Is Improving Fan Transactions at Sports Venues"], dtype=object),
 'categories_xf': array([1., 1., 0., 0., 0., 0., 0., 0., 0.,0.'], dtype=object), 
}

from model-analysis.

mdreves avatar mdreves commented on August 15, 2024

Sorry for late reply. This error is caused when the label output after processing is empty. I'm having trouble reproducing this issue with the information provided. Can you try with the latest release and let me know if you still see this.

from model-analysis.

arghyaganguly avatar arghyaganguly commented on August 15, 2024

@albertnanda , please reply on the above comment.Thanks.

from model-analysis.

arghyaganguly avatar arghyaganguly commented on August 15, 2024

Closing as this issue is in "awaiting response" status for more than 1 month. Please take a look into the answers provided above and post your comments(if you still have queries on this). Thank you!

from model-analysis.

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.