Yonisen / WarThunder_Map_Marker_Finder

Дальномер по желтой метке на карте
61 stars 10 forks source link

seems cuda does not match with my cpu... #3

Open WJerry66 opened 1 year ago

WJerry66 commented 1 year ago

Traceback (most recent call last): File "C:\Users\20887\Desktop\distance\miniMap.py", line 93, in process = distanceFinder.checkDistance(model) Desktop\distance\code\distanceFinder.py", line 91, in checkDistance tankArrow = i.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

there is a type error being raised, and the program terminated, my cpu does not support the cuda

I am not sure what could I do to fix this, could u please give me some advice?

WJerry66 commented 1 year ago

btw, my monitor resolution is 2560x1600,but i manually set it as window mode, 2560x1440. I'm not sure if this could be an issue

Yonisen commented 1 year ago

try this: go to folder 'code' open file 'distanceFinder.py' with code editor go to strings number 91 and 93 and change: tankArrow = i.numpy() to: tankArrow = i.numpy(force=True) and: yellowMarker = i.numpy() to: yellowMarker = i.numpy(force=True)

WJerry66 commented 1 year ago

thank you! it works;) but there is another exception raised

Initialization of neural network YOLOv5 2023-2-6 Python-3.10.9 torch-1.13.0+cu116 CUDA:0 (NVIDIA GeForce RTX 3070 Laptop GPU, 8192MiB)

Loading code\yolo5\best.onnx for ONNX Runtime inference... Adding AutoShape...

The program is waiting for a keystroke

Tank position (171.02439453781292, 524.2225942304058) Center of the yellow mark (217.05326744817918, 180.67533316663517) Traceback (most recent call last): File "C:\Users\20887\Desktop\distance\miniMap.py", line 93, in process = distanceFinder.checkDistance(model) File "C:\Users\20887\Desktop\distance\code\distanceFinder.py", line 185, in checkDistance abukva = cv2.imread(f"../data/resolution_{resolution}/aletter.png") File "C:\Users\20887\Desktop\distance\code/yolo5\utils\general.py", line 1090, in imread return cv2.imdecode(np.fromfile(path, np.uint8), flags) FileNotFoundError: [Errno 2] No such file or directory: '../data/resolution_2/aletter.png'

when I look the files in C:\Users\20887\Desktop\distance\code\yolo5\data there is no resolution_2 folder, and aletter.png

Yonisen commented 1 year ago

ok, distance and data folders must be in the same shared folder

WJerry66 commented 1 year ago

my bad, I wrongly unzip it Thank you for your reply and contribution to the program!