GithubHelp home page GithubHelp logo

Comments (8)

marcellacornia avatar marcellacornia commented on May 27, 2024

Hi @Mageshwaran2314,
thanks for downloading our code.

Please check your Keras and Theano versions. Our code is compatible with Keras 1.1.0 and Theano 0.9.0.

from sam.

Mageshwaran2314 avatar Mageshwaran2314 commented on May 27, 2024

yes I try to run this code with keras 2.1.3

I made some changes to the code, after that, I got this error

Using Theano backend.
Traceback (most recent call last):
File "main.py", line 63, in
m = Model(input=[x, x_maps], output=sam_resnet([x, x_maps]))
File "E:\sam-master\models.py", line 130, in sam_resnet
dcn = dcn_resnet(input_tensor=x[0])
File "E:\sam-master\dcn_resnet.py", line 143, in dcn_resnet
x = conv_block(x, 3, [64, 64, 256], stage=2, block='a', strides=(1, 1))
File "E:\sam-master\dcn_resnet.py", line 50, in conv_block
name=conv_name_base + '2a')(input_tensor)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\legacy\interfaces.py", line 56, in wrapper
raise_duplicate_arg_error(old_name, new_name)
File "C:\ProgramData\Anaconda3\lib\site-packages\keras\legacy\interfaces.py", line 106, in raise_duplicate_arg_error
'' + new_arg + '. Stick to the latter!')
TypeError: For the strides argument, the layer received both the legacy keyword argument subsample and the Keras 2 keyword argument strides. Stick to the latter!

Help me with this

from sam.

marcellacornia avatar marcellacornia commented on May 27, 2024

It seems that you are still using Keras 2.

You have to check your keras.json file. It should be in the following format:

{
    "image_dim_ordering": "th", 
    "epsilon": 1e-07, 
    "floatx": "float32", 
    "backend": "theano"
}

from sam.

Mageshwaran2314 avatar Mageshwaran2314 commented on May 27, 2024

already I change this
{
"floatx": "float32",
"epsilon": 1e-07,
"image_dim_ordering": "th",
"backend": "theano"
}

from sam.

 avatar commented on May 27, 2024

Traceback (most recent call last):
File "/home/bl/PycharmProjects/Predicting Human Eye Fixations via an LSTM-based Saliency Attentive Model/main.py", line 66, in
m = Model(input=[x, x_maps], output=sam_vgg([x, x_maps]))
File "/home/bl/PycharmProjects/Predicting Human Eye Fixations via an LSTM-based Saliency Attentive Model/models.py", line 107, in sam_vgg
nb_cols=3, nb_rows=3)(att_convlstm)
File "/usr/local/lib/python2.7/dist-packages/Keras-2.0.3-py2.7.egg/keras/engine/topology.py", line 578, in call
output = self.call(inputs, **kwargs)
File "/home/bl/PycharmProjects/Predicting Human Eye Fixations via an LSTM-based Saliency Attentive Model/attentive_convlstm.py", line 143, in call
initial_states = self.get_initial_states(x)
File "/home/bl/PycharmProjects/Predicting Human Eye Fixations via an LSTM-based Saliency Attentive Model/attentive_convlstm.py", line 42, in get_initial_states
initial_state = K.conv2d(initial_state, K.zeros((self.nb_filters_out, self.nb_filters_in, 1, 1)), border_mode='same')
TypeError: conv2d() got an unexpected keyword argument 'border_mode'
why?

from sam.

 avatar commented on May 27, 2024

import keras
print keras.version
import theano as th
print th.version

2.0.3
0.8.2

from sam.

 avatar commented on May 27, 2024

Traceback (most recent call last):
File "/home/bl/PycharmProjects/Predicting Human Eye Fixations via an LSTM-based Saliency Attentive Model/main.py", line 77, in
m = Model(input=[x, x_maps], output=sam_resnet([x, x_maps]))
File "/home/bl/PycharmProjects/Predicting Human Eye Fixations via an LSTM-based Saliency Attentive Model/models.py", line 136, in sam_resnet
nb_cols=3, nb_rows=3)(att_convlstm)
File "/usr/local/lib/python2.7/dist-packages/Keras-2.0.3-py2.7.egg/keras/engine/topology.py", line 578, in call
output = self.call(inputs, **kwargs)
File "/home/bl/PycharmProjects/Predicting Human Eye Fixations via an LSTM-based Saliency Attentive Model/attentive_convlstm.py", line 147, in call
initial_states = self.get_initial_states(x)
File "/home/bl/PycharmProjects/Predicting Human Eye Fixations via an LSTM-based Saliency Attentive Model/attentive_convlstm.py", line 43, in get_initial_states
initial_state = K.conv2d(initial_state, K.zeros((self.nb_filters_out, self.nb_filters_in, 1, 1)), padding='same')
File "/usr/local/lib/python2.7/dist-packages/Keras-2.0.3-py2.7.egg/keras/backend/tensorflow_backend.py", line 2921, in conv2d
data_format='NHWC')
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 650, in convolution
num_spatial_dims]))
ValueError: number of input channels does not match corresponding dimension of filter, 512 != 1

from sam.

ZhenyueQin avatar ZhenyueQin commented on May 27, 2024

initial_state = K.conv2d(initial_state, K.zeros((self.nb_filters_out, self.nb_filters_in, 1, 1)), padding='same')
This solves the issue

from sam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.