Comments (7)
@AnushaMehta the problem here is that you are trying to reshape "loaded[16:]" array which has in total 1,20,58,624 values to a tensor of dimension (602,256,256,1) which has 3,94,52,672 values. So as you might have observed by now that this is not possible, you need to reshape into shape of (-1, 256, 256, 1). Here -1 is the dimension value accordingly calculated automatically. Is your doubt clear by now?
@parinaya-007 Thank you so much. It works.
from capsnet-tensorflow.
Hi,
I have another error when I use another dataset. my data is 32x32x3. consists of train.tar.gz and test.tar.gz only. error:
cannot reshape array of size 651786224 into shape(73257,32,32,3)
from capsnet-tensorflow.
@guddulrk you must first hand simulate the output of conv1 in your case of input to conv1 i.e., 48x48x3. You will see that output of conv1 in your case will be different i.e., it will be [cfg.batch_size, 40, 40, 256] as per the current code of capsnet.py .
from capsnet-tensorflow.
@SOLOYT You cannot reshape array of size 651786224 into [ _, 32, 32, 3] as 651786224 is not a multiple of 32x32x3. Please look into what you actually have to do or you can elaborate here so that we can discuss it further.
from capsnet-tensorflow.
Hi,
I have the error like this. My data is 40x40x1. error:
(is_training=True)Assign requires shapes of both tensors to match. lhs shape= [1024,1600] rhs shape= [1024,784]
(is_training=False)Assign requires shapes of both tensors to match. lhs shape= [1,4608,160,8,1] rhs shape= [1,1152,160,8,1]
I have already modified the parameter "height=40" and "width=40" in capsNet.py, line 20.
num_label is 10. No change.
My error maybe occur in this line. I'm not sure:
c_api.TF_GetCode(self.status.status))
from capsnet-tensorflow.
trainX = loaded[16:].reshape((602, 256, 256, 1)).astype(np.float32)
ValueError: cannot reshape array of size 12058624 into shape (602,256,256,1)
Getting the same error. Can anyone tell me the reason. I have just replace mnist dataset with custom dataset which has 602 grayscale images with 256x256 dimension. Any new suggestions are welcome as I am very new to this programming.
What is the meaning of line ' trainX = loaded[16:].reshape((602, 256, 256, 1)).astype(np.float32)'. I have just replaced numbers according to custom dataset.
Thank you.
from capsnet-tensorflow.
@AnushaMehta the problem here is that you are trying to reshape "loaded[16:]" array which has in total 1,20,58,624 values to a tensor of dimension (602,256,256,1) which has 3,94,52,672 values. So as you might have observed by now that this is not possible, you need to reshape into shape of (-1, 256, 256, 1). Here -1 is the dimension value accordingly calculated automatically. Is your doubt clear by now?
from capsnet-tensorflow.
Related Issues (20)
- Only 10% accuracy for scaled images!!!!! HOT 3
- reshape question
- a question HOT 1
- Question about num_outputs
- Using Caps-Net to Handle High-dimensional and Small-sample Problems HOT 1
- I have question about loss function. something wrong, i think....? HOT 3
- Baidu Link Not Working Correctly: Mirror?
- Cannot handle rotation ??? HOT 1
- English Version of Blog HOT 1
- Medical Imaging HOT 7
- Vector Length HOT 3
- About the routing biases HOT 2
- TypeError: 'numpy.ndarray' object is not callable!
- a quesion HOT 1
- about tensorflow c++
- about
- about a problem in gpu_version
- How to save model in SavedModel or frozen_graph format?
- Cap
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capsnet-tensorflow.