Anusha Mehta
Anusha Mehta

Reputation: 99

What is the meaning of line ' trainX = loaded[16:].reshape((602, 256, 256, 1)).astype(np.float32)'?

I am working with capsule networks. Here is the code I am referencing.

I am using own dataset of training images 602. The dimension of image is 256x256 grayscale images.

I am not getting meaning of specific line in main file

trainX = loaded[16:].reshape((602, 256, 256, 1)).astype(np.float32)

Because of this,I am getting error

ValueError: cannot reshape array of size 12058624 into shape (602,256,256,1)

Can anyone help me getting out of this. Thank you.

Upvotes: 0

Views: 95

Answers (1)

Anusha Mehta
Anusha Mehta

Reputation: 99

Replacing (602,256,256,1) by (-1,256,256,1), the ValueError is resolved. Here, -1 represents dimension value accordingly that calculated automatically.

The reference is here https://github.com/naturomics/CapsNet-Tensorflow/issues/69.

Upvotes: 1

Related Questions