google / google/python-fire

Dynamically dispatch function but do not print result

Đang mở
#231 3 bình luận 1 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Python
Star
28.2k
Fork
1.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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`
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.