marcellacornia / mlnet

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

Error when computing saliency map: "TypeError: '<' not supported between instances of 'NoneType' and 'str'" #9

Closed msclar closed 7 years ago

msclar commented 7 years ago

Hi! I tried to compute a saliency map for a colored image and for a black and white one, and in both cases I'm getting this error when executing python main.py test images/

Using Theano backend. /usr/lib/python3.6/site-packages/keras/backend/theano_backend.py:1282: UserWarning: DEPRECATION: the 'ds' parameter is not going to exist anymore as it is going to be replaced by the parameter 'ws'. mode='max') /usr/lib/python3.6/site-packages/keras/backend/theano_backend.py:1282: UserWarning: DEPRECATION: the 'st' parameter is not going to exist anymore as it is going to be replaced by the parameter 'stride'. mode='max') /usr/lib/python3.6/site-packages/keras/backend/theano_backend.py:1282: UserWarning: DEPRECATION: the 'padding' parameter is not going to exist anymore as it is going to be replaced by the parameter 'pad'. mode='max') (None, 3, 480, 640) (None, 3, 480, 640) (None, 3, 480, 640) (None, 64, 480, 640) (None, 64, 480, 640) (None, 64, 480, 640) (None, 64, 480, 640) (None, 64, 240, 320) (None, 64, 240, 320) (None, 128, 240, 320) (None, 128, 240, 320) (None, 128, 240, 320) (None, 128, 240, 320) (None, 128, 120, 160) (None, 128, 120, 160) (None, 256, 120, 160) (None, 256, 120, 160) (None, 256, 120, 160) (None, 256, 120, 160) (None, 256, 120, 160) (None, 256, 120, 160) (None, 256, 60, 80) (None, 256, 60, 80) (None, 512, 60, 80) (None, 512, 60, 80) (None, 512, 60, 80) (None, 512, 60, 80) (None, 512, 60, 80) (None, 512, 60, 80) (None, 512, 60, 80) (None, 512, 60, 80) (None, 512, 60, 80) (None, 512, 60, 80) (None, 512, 60, 80) (None, 512, 60, 80) (None, 512, 60, 80) [(None, 256, 60, 80), (None, 512, 60, 80), (None, 512, 60, 80)] (None, 1280, 60, 80) (None, 1280, 60, 80) (None, 1280, 60, 80) (None, 1280, 60, 80) (None, 64, 60, 80) (None, 64, 60, 80) (None, 1, 60, 80) (None, 1, 60, 80) (None, 1, 60, 80) (None, 1, 60, 80) (None, 1, 60, 80) Compile ML-Net Model Traceback (most recent call last): File "main.py", line 46, in model.compile(sgd, loss) File "/usr/lib/python3.6/site-packages/keras/engine/training.py", line 683, in compile self._collected_trainable_weights = collect_trainable_weights(self) File "/usr/lib/python3.6/site-packages/keras/engine/training.py", line 258, in collect_trainable_weights weights.sort(key=lambda x: x.name) TypeError: '<' not supported between instances of 'NoneType' and 'str'

Do you know why is this happening? I'm using Keras 1.1.0 configured for using Theano as backend and Theano 0.9.0.

Thanks a lot, Melanie

marcellacornia commented 7 years ago

Hi @msclar, thanks for downloading our code.

The error seems to be related to the Python version. Keras is compatible with Python 2.7-3.5. I suggest to try with Python 2.7 which is the version I used.

msclar commented 7 years ago

Thanks a lot, Marcella! That solved the issue. My Python version was 3.6.1.