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

ValueError running spatial_stream_cnn.py #9

Closed
yclai1114 opened this issue Feb 26, 2017 · 18 comments
Closed

ValueError running spatial_stream_cnn.py #9

yclai1114 opened this issue Feb 26, 2017 · 18 comments

Comments

@yclai1114
Copy link

Using Theano backend.
Making model...
Compiling model...
Loading train dictionary...
Loading test dictionary...
Training model...
spatial_stream_cnn.py:23: FutureWarning: comparison to None will result in an elementwise object comparison in the future.
if (X_train!=None and Y_train!=None):
(0,) <--------print(X_sample.shape)
Traceback (most recent call last):
File "spatial_stream_cnn.py", line 168, in
train(model, nb_epoch, spatial_train_data, spatial_test_data, chunk_size, nb_classes, img_rows, img_cols, batch_size)
File "spatial_stream_cnn.py", line 67, in train
datagen.fit(X_sample)
File "/usr/local/lib/python2.7/dist-packages/keras/preprocessing/image.py", line 578, in fit
'Got array with shape: ' + str(x.shape))
ValueError: Input to .fit() should have rank 4. Got array with shape: (0,)

@wadhwasahil
Copy link
Owner

wadhwasahil commented Feb 26, 2017

See #8. The dimension of the input should be of the format [batch_size, X, Y, no_of_channels].

@yclai1114
Copy link
Author

yclai1114 commented Mar 1, 2017 via email

@wadhwasahil
Copy link
Owner

you can but still you have to load the pickle into the memory and then increase/decrease the no of keys.

@yclai1114
Copy link
Author

yclai1114 commented Mar 1, 2017 via email

@yclai1114
Copy link
Author

yclai1114 commented Mar 1, 2017 via email

@wadhwasahil
Copy link
Owner

You can remove according to your choice.

  • Load the pickle in the memory. Let's say it has 1K keys.
  • Remove 500 keys using python. To do this, iterate through the dictionary and pick only 500 keys and create another pickle from this.

or maybe try this?
http://stackoverflow.com/questions/17521379/python-remove-entry-from-pickle-saved-data

@yclai1114
Copy link
Author

yclai1114 commented Mar 1, 2017 via email

@wadhwasahil
Copy link
Owner

what's main.py, what does it do?

@yclai1114
Copy link
Author

yclai1114 commented Mar 1, 2017 via email

@wadhwasahil
Copy link
Owner

Can you please refer the issue here?

@yclai1114
Copy link
Author

yclai1114 commented Mar 1, 2017 via email

@wadhwasahil
Copy link
Owner

The link is broken 😢

@yclai1114
Copy link
Author

yclai1114 commented Mar 1, 2017 via email

@yclai1114
Copy link
Author

yclai1114 commented Mar 1, 2017 via email

@wadhwasahil
Copy link
Owner

I think she is talking about this file
spatial_stream_cnn.py. This is the main file for training the spatial CNN.

@yclai1114
Copy link
Author

yclai1114 commented Mar 2, 2017 via email

@wadhwasahil
Copy link
Owner

No. But you can write it yourself, it'll be very easy.
Thanks.

@yclai1114
Copy link
Author

yclai1114 commented Mar 2, 2017 via email

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