bug in run_on_test_generator
When using the run_on_test_generator
method with return_raw_output=False
, I get the following error:
/home/oliver/envs/env-ketos-py37/lib/python3.7/site-packages/ketos/neural_networks/dev_utils/nn_interface.py:1403: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
predictions = np.array(predictions)
Traceback (most recent call last):
File "run_on_test.py", line 34, in <module>
predictions = resnet.run_on_test_generator(return_raw_output=False, compute_val_metrics=True, verbose=True)
File "/home/oliver/envs/env-ketos-py37/lib/python3.7/site-packages/ketos/neural_networks/dev_utils/nn_interface.py", line 1406, in run_on_test_generator
reshaped_predictions = predictions.reshape(-1, predictions.shape[2])
IndexError: tuple index out of range
Closing remaining open files:/home/oliver/data/narw/dclde/dclde_nm5.h5...done
If instead, I use the method with return_raw_output=True
, the error disappears (but the warning remains).
Also, upon inspecting the nn_interface`` module, I found what appears to be two separate, and slightly different, implementations of the
run_on_test_generator` method. @fsfrazao , is this intentional?
Finally, I thought we could add an option to include the computed metrics as return arguments. With the present implementation, the metrics are printed to the monitor, but not returned for futher processing.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information