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 Issue #19

Closed
shadow111 opened this issue Mar 1, 2018 · 3 comments
Closed

Training Issue #19

shadow111 opened this issue Mar 1, 2018 · 3 comments

Comments

@shadow111
Copy link

when i run this command
python train_full.py \ --img_file=/path/to/images.npy \ --mask_file=/path/to/masks.npy

i got this error:

Traceback (most recent call last): File "train_full.py", line 96, in <module> train(**vars(args)) File "train_full.py", line 21, in train train_gen, validation_gen, img_shape = load_data(img_file, mask_file) File "/home/lafi/Desktop/HairSegmentation/mobile-semantic-segmentation-master/data.py", line 60, in load_data train_img_gen.fit(images) File "/usr/local/lib/python2.7/dist-packages/keras/preprocessing/image.py", line 675, in fit 'Got array with shape: ' + str(x.shape)) ValueError: Input to .fit()should have rank 4. Got array with shape: (0,)
Please how i can fix it
Thank you
Lafi

@edumucelli
Copy link

Are you using the placeholder path path/to/images.npy? You should replace it by your actual path.

@AlexRablau
Copy link

I am having the same issue.

I do use the correct paths. Without the correct paths it does not even get this far.

I am using python3. Could that be the issue?

@AlexRablau
Copy link

I discovered the issue for me.

I did not have the training images in the correct folder hierarchy.

Make sure you do:

data/
raw/
images/
0001.jpg
0002.jpg
masks/
0001.ppm
0002.ppm

I accidentally had all the images in a folder called "raw" and the masks in a separate folder called "masks". The "images" and "masks" folders must go inside the "raw" folder.

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

4 participants