galeone/tfgo

Create mapping from model for model.Exec

Open

#32 ouverte le 17 févr. 2020

Voir sur GitHub
 (4 commentaires) (0 réactions) (0 assignés)Go (157 forks)github user discovery
help wanted

Métriques du dépôt

Stars
 (2 492 stars)
Métriques de merge PR
 (Métriques PR en attente)

Description

Hi,

Is there a way to automatically create the mapping for the Placeholder (e.g. Placeholder_1) to the input name (e.g. Height) from the model?

Also is there a way to automatically read the "prob_out" from the model?

[]tf.Output and map[tf.Output]*tf.Tensor are both used for model.Exec:

height, _ := tf.NewTensor([1]int64{"Height"})
width, _ := tf.NewTensor([1]int64{"Width"})

results := model.Exec([]tf.Output{
    model.Op("prob_out", 0),
}, map[tf.Output]*tf.Tensor{
   model.Op("Placeholder_1", 0): height,
   model.Op("Placeholder_2", 0): width,
})

Thanks.

Guide contributeur