I have an AMD GPU and I want to train my model with using that GPU because on a CPU it takes a while. I did some research and I found Microsoft's Direct ML and I thought I would give it a go.
Here's the article I found and followed: https://docs.microsoft.com/en-gb/windows/ai/directml/gpu-tensorflow-plugin
I am using python 3.10.2 and on the site it says that version is supported. So I activated my environment and installed the plugin. I went back to my code which is written in jupyter notebook and once I run:
train_set = image_dataset_from_directory(
train_path,
labels="inferred",
label_mode = 'categorical',
image_size=IMG_SIZE,
batch_size=batch_size,
)
dev_set = image_dataset_from_directory(
dev_path,
labels="inferred",
label_mode = 'categorical',
image_size=IMG_SIZE,
batch_size=batch_size,
)
test_set = image_dataset_from_directory(
test_path,
labels="inferred",
label_mode = 'categorical',
image_size=IMG_SIZE,
batch_size=batch_size,
)
class_names = train_set.class_names
num_classes = len(class_names)
I got this error:
InvalidArgumentError: Multiple OpKernel registrations match NodeDef at the same priority '{{node Equal}}': 'op: "Equal" device_type: "GPU" constraint { name: "T" allowed_values { list { type: DT_INT64 } } }' and 'op: "Equal" device_type: "GPU" constraint { name: "T" allowed_values { list { type: DT_INT64 } } }' [Op:Equal]
Running this:
print(tf.__version__)
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
2.9.1
Num GPUs Available: 1
I have no idea what is going on. Can I not use directml? It is detecting my GPU (RX Vega 64)..
