marcellacornia / mlnet

A Deep Multi-Level Network for Saliency Prediction. ICPR 2016
MIT License
94 stars 37 forks source link

can't use ratio and frac_ratio together Error #12

Closed MartaCollPol closed 6 years ago

MartaCollPol commented 6 years ago

Hello, I'm trying to use your model for testing a dataset but a strange error is raised when loading the model, do you have any idea on which could be the cause? Thank you in advance!

Traceback (most recent call last): File "main.py", line 43, in model = ml_net_model(img_cols=shape_c, img_rows=shape_r, downsampling_factor_product=10) File "/home/marta/Documents/Recerca_2017/TFG/MLNet/model.py", line 78, in ml_net_model eltprod = EltWiseProduct(init='zero', W_regularizer=l2(1/(rows_eltcols_elt)))(pre_final_conv) File "/home/marta/Documents/Recerca_2017/TFG/virualenv/MLNetenv/local/lib/python2.7/site-packages/keras/engine/topology.py", line 514, in call self.add_inbound_node(inbound_layers, node_indices, tensor_indices) File "/home/marta/Documents/Recerca_2017/TFG/virualenv/MLNetenv/local/lib/python2.7/site-packages/keras/engine/topology.py", line 572, in add_inbound_node Node.create_node(self, inbound_layers, node_indices, tensor_indices) File "/home/marta/Documents/Recerca_2017/TFG/virualenv/MLNetenv/local/lib/python2.7/site-packages/keras/engine/topology.py", line 149, in create_node output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0])) File "/home/marta/Documents/Recerca_2017/TFG/MLNet/eltwise_product.py", line 56, in call output = xT.nnet.abstract_conv.bilinear_upsampling(K.expand_dims(K.expand_dims(1 + self.W, 0), 0), self.downsampling_factor, 1, 1) File "/home/marta/Documents/Recerca_2017/TFG/virualenv/MLNetenv/local/lib/python2.7/site-packages/theano/tensor/nnet/abstract_conv.py", line 1900, in bilinear_upsampling raise ValueError("can't use ratio and frac_ratio together") ValueError: can't use ratio and frac_ratio together

marcellacornia commented 6 years ago

Hi @MartaCollPol, thanks for downloading our code.

Which Keras version are you using? Our code is compatible with Keras 1.1.0 using Theano as backend. Be sure to have "image_dim_ordering": "th" and "backend": "theano" in your keras.json file.

MartaCollPol commented 6 years ago

Apparently the problem was with the theano version I was using. It's solved now and working! Thank you