Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cv2.error: OpenCV(4.8.0) 👎 error: (-5:Bad argument) in function 'imencode' > Overload resolution failed: > - Can't parse 'params'. Sequence item with index 1 has a wrong type > - Can't parse 'params'. Sequence item with index 1 has a wrong type #16

Open
dqyyds opened this issue Jul 22, 2023 · 3 comments

Comments

@dqyyds
Copy link

dqyyds commented Jul 22, 2023

I met this problem when I tried to run the command CUDA_VISIBLE_DEVICES=0 python main_sr.py --cfg_path configs/training/swinir_ffhq512.yaml --save_dir save_dir_1 Could someone help me solve it?

@zsyOAOA
Copy link
Owner

zsyOAOA commented Jul 22, 2023

It seems that opencv failed to read your image. Please have a try read your image with opencv.

@dqyyds
Copy link
Author

dqyyds commented Jul 22, 2023

File "/home/ubuntu/extend/dq/newest/DifFace-master/datapipe/ffhq_degradation_dataset.py", line 176, in getitem
img_lq = degradations.random_add_jpg_compression(img_lq, self.jpeg_range)
File "/home/ubuntu/extend/dq/newest/DifFace-master/basicsr/data/degradations.py", line 764, in random_add_jpg_compression
return add_jpg_compression(img, quality)
File "/home/ubuntu/extend/dq/newest/DifFace-master/basicsr/data/degradations.py", line 745, in add_jpg_compression
_, encimg = cv2.imencode('.jpg', img * 255., encode_param)
cv2.error: OpenCV(4.8.0) 👎 error: (-5:Bad argument) in function 'imencode'

Overload resolution failed:

  • Can't parse 'params'. Sequence item with index 1 has a wrong type
  • Can't parse 'params'. Sequence item with index 1 has a wrong type

It shows that there is a problem here, but I see that there is no problem with the code, can you tell me the version of opencv you are using

@dqyyds
Copy link
Author

dqyyds commented Jul 22, 2023

It solved. Thank you! It's a problem with the opencv version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants