zhiyuanyou / SAFECount

[WACV 2023] Few-shot Object Counting with Similarity-Aware Feature Enhancement
Other
124 stars 22 forks source link

Hello , I fund a error when I run the file the named train_val.py. #20

Closed Lay-best closed 1 year ago

Lay-best commented 1 year ago

When I run the order that "python train_val.py -t" in the terminal , a error was found . ` File "D:\E-data\python-code\Counting\SAFECount-main\tools\train_val.py", line 302, in eval visualizer.vis_batch(outputs) File "D:\E-data\python-code\Counting\SAFECount-main\tools..\utils\vis_helper.py", line 85, in vis_batch self.vis_result(filename, resname, height, width, output) File "D:\E-data\python-code\Counting\SAFECount-main\tools..\utils\vis_helper.py", line 58, in vis_result output = cv2.resize(output, (width, height)) cv2.error: OpenCV(4.7.0) :-1: error: (-5:Bad argument) in function 'resize'

Overload resolution failed:

  • Can't parse 'dsize'. Sequence item with index 0 has a wrong type
  • Can't parse 'dsize'. Sequence item with index 0 has a wrong type ` Can you tell me how to address it please.
zhiyuanyou commented 1 year ago

It is hard to say, since the codes have never been verified on Windows.

Haalum commented 11 months ago

It's because of your CV2 version. Try opencv-python=3.4.10.37 version as mentioned in the requirements.txt file. Follow the requirements file to install the other packages.

mast1ren commented 5 months ago

It happened to me, and I found the $height$ and $width$ are on the GPU, it worked after put them on the CPU.