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

Error when trying data2lmdb #50

Open
matthiasmace opened this issue Nov 15, 2017 · 1 comment
Open

Error when trying data2lmdb #50

matthiasmace opened this issue Nov 15, 2017 · 1 comment

Comments

@matthiasmace
Copy link

Hi when trying to train crfasrnn with my own data, I get stuck in data preparation. I guess it could arise from malformed PNG but I do not get the solution. Any idea ?

python2.7 data2lmdb.py
3 train images
0 test images
Train images
Traceback (most recent call last):
File "data2lmdb.py", line 235, in
main()
File "data2lmdb.py", line 54, in main
convert2lmdb(path_src, train_imgs, image_ext, path_dst, class_ids, preprocess_mode, im_sz, 'image')
File "data2lmdb.py", line 161, in convert2lmdb
img = preprocess_image(img, preprocess_mode, im_sz)
File "data2lmdb.py", line 167, in preprocess_image
img = preprocess_data(img, mode, im_sz, 'image')
File "data2lmdb.py", line 197, in preprocess_data
img = np.pad(img, ((0, im_sz-img.shape[0]), (0, im_sz-img.shape[1]), (0,0)), 'constant', constant_values=(0))
File "/usr/local/lib/python2.7/site-packages/numpy/lib/arraypad.py", line 1295, in pad
pad_width = _validate_lengths(narray, pad_width)
File "/usr/local/lib/python2.7/site-packages/numpy/lib/arraypad.py", line 1086, in _validate_lengths
raise ValueError(fmt % (number_elements,))
ValueError: ((0, -100), (0, -524), (0, 0)) cannot contain negative values.

@Sam813
Copy link

Sam813 commented May 21, 2018

your input image size is bigger than 500 x 500

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