You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 - <group|command|value> | --inputs=INPUTS <flags> [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`
The text was updated successfully, but these errors were encountered:
One way you might be able to do something like this is by using contextlib.redirect_stdout to suppress the output. For example, you could redirect to /dev/null (or platform equivalent)
importosimportcontextlibwithopen(os.devnull, 'w') asdevnull:
withcontextlib.redirect_stdout(devnull):
ret=fire.Fire(something)
# do something with ret
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 I try to run the previous code, for instance:
I get the following error:
The text was updated successfully, but these errors were encountered: