问题
I have a list with multiply identities and each identity consists of multiple images. When i am retrieving positive images from json list it works fine. After that I am mixing this positive list with by doing cross product with every images in pair form and then save in negative array. When i am doing cross product, my system got completely hang even i have 16 GB RAM with GPU.
Code
for i in range(0, len(idendities) - 1):
for j in range(i + 1, len(idendities)):
# print(samples_list[i], " vs ",samples_list[j])
cross_product = itertools.product(samples_list[i], samples_list[j])
cross_product = list(cross_product)
# print(cross_product)
for cross_sample in cross_product:
# print(cross_sample[0], " vs ", cross_sample[1])
negative = []
negative.append(cross_sample[0])
negative.append(cross_sample[1])
negatives.append(negative)
negatives = pd.DataFrame(negatives, columns=["file_x", "file_y"])
negatives["decision"] = "No"
negatives = negatives.sample(positives.shape[0])
来源:https://stackoverflow.com/questions/65629130/used-numba-to-consume-gpu-instead-of-cpu-in-loop