vendredi 26 novembre 2021

How to use GPU in the if-else loop code as follows?

How to use GPU in the if-else loop code as follows? When I run the code in Colab, it shows that I do not use the GPU... The speed is very slow for this code in Colad.

created_images=[]
for j in range (len(training_df)):
    if training_df[j][1]==1:
        for k in range(8):
            transformed_image = transform_train(training_df[j][0])
            created_images.append((transformed_image,1))
    else:
        transformed_image = transform_train(training_df[j][0])
        created_images.append((transformed_image,0))

print(len(created_images))

Aucun commentaire:

Enregistrer un commentaire