When I try to run Keras code on my spyder console using Python 2.7, I get this error about no attribute of 'new_TF_Output'.

The entire traceback is here just for reference:

File "<ipython-input-7-f9bf405379e5>", line 1, in <module>
runfile('.../mainK.py', wdir='/home/abhi/Documents/Hyper/CNN/HyperXKeras')

File ".../dist-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile
execfile(filename, namespace)

File ".../dist-packages/spyder/utils/site/sitecustomize.py", line 94, in execfile
builtins.execfile(filename, *where)

File ".../mainK.py", line 187, in <module>
model,model_name, optimizer, loss, hyperparams = model(MODEL, **hyperparams)

File "model_keras.py", line 89, in get_model
model,model_name = model.build(n_bands, n_classes, patch_size=patch_size)

File "model_keras.py", line 417, in build
input_x=Input(shape=(1,input_channels,patch_size,patch_size))

File ".../dist-packages/keras/engine/topology.py", line 1439, in Input
input_tensor=tensor)

File ".../dist-packages/keras/legacy/interfaces.py", line 87, in wrapper
return func(*args, **kwargs)

File ".../dist-packages/keras/engine/topology.py", line 1348, in __init__
name=self.name)

File ".../dist-packages/keras/backend/tensorflow_backend.py", line 497, in placeholder
x = tf.placeholder(dtype, shape=shape, name=name)

File ".../site-packages/tensorflow/python/ops/array_ops.py", line 1808, in placeholder
return gen_array_ops.placeholder(dtype=dtype, shape=shape, name=name)

File ".../site-packages/tensorflow/python/ops/gen_array_ops.py", line 4848, in placeholder
"Placeholder", dtype=dtype, shape=shape, name=name)

File ".../site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)

File ".../site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
op_def=op_def)

File ".../site-packages/tensorflow/python/framework/ops.py", line 1749, in __init__
for i in range(num_outputs)]

File ".../site-packages/tensorflow/python/framework/c_api_util.py", line 135, in tf_output
ret = c_api.TF_Output()

File ".../python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 957, in __init__
this = _pywrap_tensorflow_internal.new_TF_Output()

The versions that I am using currently:

Keras 2.1.2

Tensorflow 1.1.4

Numpy 1.13

Python 2.7

Do I need to upgrade or downgrade any package's version to make this error go away?

0 Answers