Skip to content

Commit

Permalink
Back to model.predict
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobiasd committed Jan 19, 2025
1 parent 49006d0 commit 356eea2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ To check if the input values really are the same, you can print them, in Python
input = ...
print(input)
print(input.shape)
result = model([input]).numpy()
result = model.predict([input])
print(result)
print(result.shape) # result[0].shape in case of multiple output tensors
```
Expand Down
2 changes: 1 addition & 1 deletion keras_export/convert_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def get_model_input_layers(model):
def measure_predict(model, data_in):
"""Returns output and duration in seconds"""
start_time = datetime.datetime.now()
data_out = model(data_in).numpy()
data_out = model.predict(data_in)
end_time = datetime.datetime.now()
duration = end_time - start_time
print('Forward pass took {} s.'.format(duration.total_seconds()))
Expand Down

0 comments on commit 356eea2

Please sign in to comment.