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

Training data ‘cv2.error’ in resize some images #123

Closed
littlejiumi opened this issue Dec 22, 2021 · 2 comments
Closed

Training data ‘cv2.error’ in resize some images #123

littlejiumi opened this issue Dec 22, 2021 · 2 comments

Comments

@littlejiumi
Copy link

The data of the 7 datasets are randomly selected for training, right? The training code can run successfully for a period of time (not more than one epoch), and then will encounter this error. Can you tell the reason? I don't know much about it,TTTThank you!

File "/root/Downloads/ROMP_ALL/ROMP/romp/lib/models/../utils/../dataset/image_base.py", line 231, in prepare_image

    dst_image = cv2.resize(image, tuple(self.input_shape), interpolation = cv2.INTER_CUBIC)

cv2.error: OpenCV(4.5.4) /tmp/pip-req-build-24v3eisa/opencv/modules/core/src/matrix.cpp:466: error: (-215:Assertion failed) _step >= minstep in function 'Mat'
@littlejiumi
Copy link
Author

OR can you tell me your version of OPENCV?

@Arthur151
Copy link
Owner

Arthur151 commented Dec 22, 2021

Sorry for the unpleasant bugs.
My Opencv is 4.1.1 on a remote server. But the version may not matter.

According to the issues submited by other users, this bug is caused by that some image is empty / failed to read via cv2. You can avoid this via try, except, for instance

try:
    dst_image = cv2.resize(image, tuple(self.input_shape), interpolation = cv2.INTER_CUBIC)
except:
    dst_image = np.zeros((self.input_shape[0], self.input_shape[1], 3))

Welcome to discuss if there is any problem related to ROMP that bother you.

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