backseason / PoolNet

Code for our CVPR 2019 paper "A Simple Pooling-Based Design for Real-Time Salient Object Detection"
MIT License
628 stars 153 forks source link

cv2.error: OpenCV(4.7.0) :-1: error: (-5:Bad argument) in function 'resize' #87

Closed Yeyu0923 closed 1 year ago

Yeyu0923 commented 1 year ago

When I run test python joint_main.py --mode='test' --model='results/run-1/models/final.pth' --test_fold='results/run-1-sal-b' --sal_mode='b' --batch_size=1 --no-cuda --test_mode=0

Traceback (most recent call last): File "joint_main.py", line 102, in main(config) File "joint_main.py", line 49, in main test.test(test_mode=config.test_mode) File "/Users/xiefeiyu/PoolNet/joint_solver.py", line 92, in test pred = cv2.resize(pred, (im_size[1], im_size[0]), interpolation=cv2.INTER_LINEAR) 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

It works fine when I don't add --test-mode=0, but when I try to get edge, I get this error I don't know why this is happening, hope someone can help me