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
The previous snippet collects all label volumes into a list (this is a memory hog and hence the reason for OOM) and then applies _labels_all_scalar.
Refactored the snippet to map each label volume into a isscalar function which returns a bool flag. Subsequently, the collected bool flags are reduced to one final bool flag.
The other (naive) approach is to run nobrainer.tfrecord._is_int_or_float() on each element of the dataset (in a for loop) and then reduce all the bool flags (similar to step 2).
I am unsure why the GPU utilization is non-zero during this operation.
I still maintain that the repeat should be delayed until after this operation. Otherwise, the entire repeated dataset will be used for this operation and is undesirable.
Caveat:
Used a tf.experimental function which may (or may not) be deprecated in the future. @satra what are your thoughts on using experimental features in the nobrainer API?
The text was updated successfully, but these errors were encountered:
this suggestion works on a small dataset and doesn't fail. however, it is still time-consuming. The non-zero GPU util may have to do with this (🤷♂️ ) as there will be an overhead in going back and forth between the CPU and GPU.
nobrainer/nobrainer/dataset.py
Lines 249 to 250 in cb855fe
Suggestion:
Notes:
_labels_all_scalar
.isscalar
function which returns a bool flag. Subsequently, the collected bool flags are reduced to one final bool flag.nobrainer.tfrecord._is_int_or_float()
on each element of the dataset (in a for loop) and then reduce all the bool flags (similar to step 2).repeat
should be delayed until after this operation. Otherwise, the entire repeated dataset will be used for this operation and is undesirable.Caveat:
tf.experimental
function which may (or may not) be deprecated in the future. @satra what are your thoughts on using experimental features in the nobrainer API?The text was updated successfully, but these errors were encountered: