Open Aditya5191 opened 3 months ago
Same issue with pytorch + autocast on a 6900xt...
I have same issue now. In 2023 used Comfy UI with the same AMD GPU and Direct ML device, it worked 100%. Maybe they broke something in resent updates?
I got working example with this:
def generate(self, prompt, steps):
self.load()
try:
with torch.no_grad(): # **Use no_grad instead of inference_mode**
images = self.pipe(
prompt=[prompt],
num_inference_steps=steps,
guidance_scale=0.0,
height=256,
width=256,
).images
return images
finally:
self.unload()
I am trying to run YoloV8 on my AMD RX550 using DirectML and every time i run the training it fails with this error RuntimeError: Cannot set version_counter for inference tensor
from ultralytics import YOLO
import torch_directml
model = YOLO("yolov8n.yaml")
dml = torch_directml.device()
model.train(data="config.yaml", epochs=200, device=dml)
This works properly if i set
device="cpu"
Please help me with this.. I'm new to Machine learning stuff.