8000 training own dataset · Issue #16 · sorenbouma/keras-oneshot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

training own dataset #16

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

Open
noelcodes opened this issue Nov 20, 2018 · 1 co 8000 mment
Open

training own dataset #16

noelcodes opened this issue Nov 20, 2018 · 1 comment

Comments

@noelcodes
Copy link

I have no issue working on load_data.py under omniglot dataset, and was able to run SiameseNet.ipynb.
However, Its only when I switch to my own dataset, I noticed you used np.stack, which errors out when my number of images in each folder is different from the next folder. Is this a requirement for Siamese to work properly? How can I get pass this?

  File "load_data.py", line 64, in <module>
    X,y,c=loadimgs(train_folder)
  File "load_data.py", line 61, in loadimgs
    X = np.stack(X)
  File "C:\Users\Noel Tam\AppData\Local\conda\conda\envs\py36\lib\site-packages\numpy\core\shape_base.py", line 353, in stack
    raise ValueError('all input arrays must have the same shape')
ValueError: all input arrays must have the same shape
@Boylad
Copy link
Boylad commented Feb 20, 2020

I have no issue working on load_data.py under omniglot dataset, and was able to run SiameseNet.ipynb.
However, Its only when I switch to my own dataset, I noticed you used np.stack, which errors out when my number of images in each folder is different from the next folder. Is this a requirement for Siamese to work properly? How can I get pass this?

  File "load_data.py", line 64, in <module>
    X,y,c=loadimgs(train_folder)
  File "load_data.py", line 61, in loadimgs
    X = np.stack(X)
  File "C:\Users\Noel Tam\AppData\Local\conda\conda\envs\py36\lib\site-packages\numpy\core\shape_base.py", line 353, in stack
    raise ValueError('all input arrays must have the same shape')
ValueError: all input arrays must have the same shape

load_data.py line 48:
image = np.array(Image.fromarray(imageio.imread(image_path)).resize([300, 300]))
I used 300 pixel by pixel for my image, the default is 105 by 105 in .ipynb file, and also for a version problem in scipy, I used pillow(PIL) to read images.

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

3 participants
@Boylad @noelcodes and others
0