tensorflowconv-neural-networkkaggle

How to use GPU for preprocessing & model training using TF in kaggle?


I have video data & need to extract frames (~ 5hr to complete on CPU). In kaggle can I use GPU to do this along with CNN model training. Unable to use GPU using TF. In Pytorch I found it easy to implement.

i tried. :

gpus = tf.config.experimental.list_physical_devices('GPU')
for gpu in gpus:
    print("Name:", gpu.name, "  Type:", gpu.device_type)
def prepare_all_videos(df, root_dir):
    device = '/device:GPU:0' if len(tf.config.list_physical_devices('GPU')) > 0 else '/device:CPU:0'
    num_samples = len(df)
    ...

Solution

  • I found that GPU only get in use, if the library support GPU acceleration. Eg: Numpy doesn't have GPU acceleration, enabling GPU in kaggle for it, doesn't work.