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

Version of Keras??? #8

Open
ArunJ1 opened this issue Jan 8, 2019 · 2 comments
Open

Version of Keras??? #8

ArunJ1 opened this issue Jan 8, 2019 · 2 comments

Comments

@ArunJ1
Copy link

ArunJ1 commented Jan 8, 2019

I have my Keras version as 2.1.2...

When i tried to run this program i got the below error:

Using TensorFlow backend.
model-basic.py:31: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(64, (3, 3), padding="valid")
Convolution2D(filter_size, kernel, kernel, border_mode='valid'),
model-basic.py:37: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(128, (3, 3), padding="valid")
Convolution2D(128, kernel, kernel, border_mode='valid'),
model-basic.py:43: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(256, (3, 3), padding="valid")
Convolution2D(256, kernel, kernel, border_mode='valid'),
model-basic.py:49: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(512, (3, 3), padding="valid")
Convolution2D(512, kernel, kernel, border_mode='valid'),
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 1628, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Negative dimension size caused by subtracting 2 from 1 for 'max_pooling2d_2/MaxPool' (op: 'MaxPool') with input shapes: [?,1,180,128].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "model-basic.py", line 91, in
segnet_basic.add(l)
File "/usr/local/lib/python3.5/dist-packages/keras/models.py", line 489, in add
output_tensor = layer(self.outputs[0])
File "/usr/local/lib/python3.5/dist-packages/keras/engine/topology.py", line 603, in call
output = self.call(inputs, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/keras/layers/pooling.py", line 154, in call
data_format=self.data_format)
File "/usr/local/lib/python3.5/dist-packages/keras/layers/pooling.py", line 217, in _pooling_function
pool_mode='max')
File "/usr/local/lib/python3.5/dist-packages/keras/backend/tensorflow_backend.py", line 3466, in pool2d
data_format=tf_data_format)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/nn_ops.py", line 2140, in max_pool
name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gen_nn_ops.py", line 4641, in max_pool
data_format=data_format, name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/deprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 3274, in create_op
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 1792, in init
control_input_ops)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 1631, in _create_c_op
raise ValueError(str(e))
ValueError: Negative dimension size caused by subtracting 2 from 1 for 'max_pooling2d_2/MaxPool' (op: 'MaxPool') with input shapes: [?,1,180,128].
*** Error in `python3': free(): invalid pointer: 0x00000000012b2760 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fa4d1bde7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fa4d1be737a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fa4d1beb53c]
/usr/lib/x86_64-linux-gnu/libprotobuf.so.9(_ZN6google8protobuf8internal28DestroyDefaultRepeatedFieldsEv+0x1f)[0x7fa47b2388af]
/usr/lib/x86_64-linux-gnu/libprotobuf.so.9(_ZN6google8protobuf23ShutdownProtobufLibraryEv+0x8b)[0x7fa47b237b3b]
/usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3(+0x233b9)[0x7fa42fdce3b9]
/lib64/ld-linux-x86-64.so.2(+0x10de7)[0x7fa4d215ede7]
/lib/x86_64-linux-gnu/libc.so.6(+0x39ff8)[0x7fa4d1ba0ff8]
/lib/x86_64-linux-gnu/libc.so.6(+0x3a045)[0x7fa4d1ba1045]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf7)[0x7fa4d1b87837]
python3(_start+0x29)[0x5d6049]

Please can you specify which version of the Keras this program requires to run???

Also please help me to resolve the issue?

Thanks,
Arun

@ArunJ1
Copy link
Author

ArunJ1 commented Jan 11, 2019

Hi,
Any reply please?
Thanks,
Arun

@jiannan0721
Copy link

Hi,
Any reply please?
Thanks,
Arun

Hi, not sure if you still need this but I got this problem myself. It is because the dimension order in theano and tensorflow is different. The author uses theano backend and the dimension for image is (3, width, height), but in tensorflow, the dimension is (width,height,3).

Repository owner deleted a comment from duskagain Feb 23, 2024
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