google / google/python-fire

Dynamically dispatch function but do not print result

Abierto
#231 3 comentarios 1 reacción 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Python
Estrellas
28.2k
Forks
1.5k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Can Fire be used to dynamically dispatch a function as in the dict example but without printing the result? I would like to do something with the return value, for instance:

```
if __name__ == "__main__":
# inception and exception are functions that return keras models,
# each having its own parameters
ret = Fire.Fire({'inception': inception,
'xception': xception})

# do something with ret
```

If I try to run the previous code, for instance:

python ./train.py inception 100 100 10

I get the following error:

```
ERROR: The function received no value for the required argument: inputs
2020-03-03 16:30:13.774542: W tensorflow/python/util/util.cc:319] Sets are not currently considered sequences, but this may change in the future, so consider avoiding using them.
Usage: train.py inception 100 100 10 - | --inputs=INPUTS [ARGS]...
available groups: inbound_nodes | input | input_names | input_shape |
inputs | layers | losses | metrics | metrics_names |
non_trainable_variables | non_trainable_weights |
outbound_nodes | output | output_names |
output_shape | outputs | state_updates | submodules |
trainable_variables | trainable_weights | updates |
variables | weights
available commands: add_loss | add_metric | add_update | add_variable |
add_weight | apply | build | call | compile |
compute_mask | compute_output_shape |
compute_output_signature | count_params | evaluate |
evaluate_generator | fit | fit_generator |
from_config | get_config | get_input_at |
get_input_mask_at | get_input_shape_at | get_layer |
get_losses_for | get_output_at | get_output_mask_at |
get_output_shape_at | get_updates_for | get_weights |
load_weights | name_scope | predict |
predict_generator | predict_on_batch | reset_metrics |
reset_states | save | save_weights | set_weights |
summary | test_on_batch | to_json | to_yaml |
train_on_batch | with_name_scope
available values: activity_regularizer | built | dtype | dynamic |
input_mask | input_spec | name | optimizer |
output_mask | run_eagerly | stateful |
supports_masking | trainable
flags are accepted

For detailed information on this command, run:
train.py inception 100 100 10 - -- --help`
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.