Open sportbilly13 opened 7 years ago
@sportbilly13 Could you paste more messages? At which line do you get this error? The model does not use channel 48 at any layer so this is weird.
The console I am getting start loading data dataset inited total size: 4 dataset inited total size: 4 done loading data, time= 0.0006747245788574219 train() called training size: 4 conv1 [None, 55, 55, 96] pool1 [None, 27, 27, 96] Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/common_shapes.py", line 671, in _call_cpp_shape_fn_impl input_tensors_as_shapes, status) File "/usr/lib/python3.5/contextlib.py", line 66, in exit next(self.gen) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimensions must be equal, but are 48 and 27 for 'conv2/Conv2D' (op: 'Conv2D') with input shapes: [?,27,27,48], [?,27,27,48].
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "train.py", line 190, in
I think in the def_conv the time it is called for the conv2 layer it gets in the else statement and stops at the line of output_groups = [convolve(i,k) for i, k in zip(input_groups, kernel_groups)] line 88 Thanks
@sportbilly13 Did you modify the input placeholder to a smaller size? (eg. 55x55 as I see in your output?) It should be 227x227.
No In the def train view_ = tf.placeholder('float32', shape=(None, V, 227, 227, 3), name='im0')
and in the model is call the conv1 conv1 = _conv('conv1', view, [11, 11, 3, 96], [1, 4, 4, 1], 'VALID', reuse=reuse) Thanks
@sportbilly13 I tested conv2d and find while I do this I get the same error:
a = tf.placeholder('float32', [None, 27,27,48])
k = tf.Variable(np.zeros((5,5,48,256)), dtype='float32')
# This get the same error with yours
tf.nn.conv2d(a,a,[1,1,1,1], padding='SAME')
# This is fine
tf.nn.conv2d(a,k,[1,1,1,1], padding='SAME')
Thus I guess the reason of the error is you convolve(i, k)
at line 88 unexpectedly runs like convolve(i, i)
. I did not get how this happen and need more testing. Maybe it's from some difference between python2 and python3? (I'm using python2.7). Could you try it with python2?
Thanks very much I will try it with python 2 and also search a little bit more if I could find something. I will let you know
Hello Wei I quite new in neural networks. I tried to run the code with not many data just to see how it will run and I am getting this error ValueError: Dimensions must be equal, but are 48 and 27 for 'conv2/Conv2D' (op: 'Conv2D') with input shapes: [?,27,27,48], [?,27,27,48]. I am running in Puthon3.5. Thanks Vasilis