Code Monkey home page Code Monkey logo

mlnet's Introduction

A Deep Multi-Level Network for Saliency Prediction

This repository contains reference code for computing Multi-Level Net (ML-Net) saliency maps based on the following paper:

Marcella Cornia, Lorenzo Baraldi, Giuseppe Serra, Rita Cucchiara. "A Deep Multi-Level Network for Saliency Prediction." In Proceedings of the 23rd International Conference on Pattern Recognition, 2016.

Please cite with the following Bibtex code:

@inproceedings{mlnet2016,
  author = {Cornia, Marcella and Baraldi, Lorenzo and Serra, Giuseppe and Cucchiara, Rita},
  title = {{A Deep Multi-Level Network for Saliency Prediction}},
  booktitle = {International Conference on Pattern Recognition (ICPR)},
  year = {2016}
}

An arXiv pre-print is available at this link.

Abstract

This paper presents a novel deep architecture for saliency prediction. Current state of the art models for saliency prediction employ Fully Convolutional networks that perform a non-linear combination of features extracted from the last convolutional layer to predict saliency maps. We propose an architecture which, instead, combines features extracted at different levels of a Convolutional Neural Network (CNN). Our model is composed of three main blocks: a feature extraction CNN, a feature encoding network, that weights low and high level feature maps, and a prior learning network. We compare our solution with state of the art saliency models on two public benchmarks datasets. Results show that our model outperforms under all evaluation metrics on the SALICON dataset, which is currently the largest public dataset for saliency prediction, and achieves competitive results on the MIT300 benchmark.

mlnet-fig

Usage

To compute saliency maps using our pre-trained model:

python main.py test path/to/images/folder/

where "path/to/images/folder/" is the path of a folder containing the images for which you want to calculate the saliency maps.

To train our model from scratch:

python main.py train

Beside, it is necessary to set parameters and paths in the config.py file.

Requirements

  • Python 2.7
  • Theano 0.9.0
  • Keras 1.1.0, configured for using Theano as backend
  • OpenCV 3.0.0

Note: Be sure to have "image_dim_ordering": "th" and "backend": "theano" in your keras.json file.

Precomputed Saliency Maps

We provide saliency maps predicted by our network for two standard datasets:

PyTorch Version

A PyTorch re-implementation of our model is available at https://github.com/immortal3/MLNet-Pytorch.

Contact

For more datails about our research please visit our page.

If you have any general doubt about our work, please use the public issues section on this github repo. Alternatively, drop us an e-mail at mailto:[email protected] or mailto:[email protected].

mlnet's People

Contributors

marcellacornia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mlnet's Issues

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

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

pytorch

could you offer the pytorch code?
thanks.

Outputs must be theano variables or Out instances

While trying to create model, it gives an error like 'TypeError: Outputs must be theano Variable or Out instances. Received convolution2d_4_W of type <class 'theano.tensor.sharedvar.TensorSharedVariable'>'

TypeError Traceback (most recent call last)
in ()
----> 1 model = ml_net_model( img_rows=480,img_cols=640,downsampling_factor_product=10)

9 frames
/usr/local/lib/python3.7/dist-packages/theano/compile/function/pfunc.py in rebuild_collect_shared(outputs, inputs, replace, updates, rebuild_strict, copy_inputs_over, no_default_updates)
225 raise TypeError(
226 "Outputs must be theano Variable or "
--> 227 "Out instances. Received " + str(v) + " of type " + str(type(v))
228 )
229 # computed_list.append(cloned_v)

TypeError: Outputs must be theano Variable or Out instances. Received convolution2d_4_W of type <class 'theano.tensor.sharedvar.TensorSharedVariable'>

Can someone help me in fixing this issue??

ImportError: cannot import name 'Layer' from 'keras.layers.core'

C:\Users\Furkan\PycharmProjects\mlnet-master\venv\Scripts\python.exe C:/Users/Furkan/PycharmProjects/mlnet-master/main.py
2020-08-24 16:56:02.256203: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-08-24 16:56:02.263070: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "C:/Users/Furkan/PycharmProjects/mlnet-master/main.py", line 8, in
from model import ml_net_model, loss
File "C:\Users\Furkan\PycharmProjects\mlnet-master\model.py", line 9, in
from eltwise_product import EltWiseProduct
File "C:\Users\Furkan\PycharmProjects\mlnet-master\eltwise_product.py", line 1, in
from keras.layers.core import Layer, InputSpec
ImportError: cannot import name 'Layer' from 'keras.layers.core' (C:\Users\Furkan\PycharmProjects\mlnet-master\venv\lib\site-packages\keras\layers\core.py)

Process finished with exit code 1

About the python version

Hi, marcella.
when I used this net to train my own dataset, something wrong like below:

Compile ML-Net Model
Training ML-Net
Traceback (most recent call last):
  File "main.py", line 58, in <module>
    ModelCheckpoint('weights.mlnet.{epoch:02d}-{val_loss:.4f}.pkl', save_best_only=True)])
  File "/usr/lib64/python2.7/site-packages/keras/engine/training.py", line 1343, in fit_generator
    self._make_train_function()
  File "/usr/lib64/python2.7/site-packages/keras/engine/training.py", line 695, in _make_train_function
    self.constraints,
  File "/usr/lib64/python2.7/site-packages/keras/engine/topology.py", line 1948, in constraints
    for key, value in layer.constraints.items():
AttributeError: 'list' object has no attribute 'items'

the python version about my machine is 2.7 .

About the multi layer

Hi,

Your paper gives me some inspiration.I found you use three layers: conv3, conv4, conv5. So, when you just use conv5 or (conv4 and conv5), you get a worse result?

I did many experiments recently.To my big disappointment, I found using multi-layer from vgg usually leads to a worse result(or not improved much), so can you give me some suggestions?

A little confused about the loss function

Hi,
I have some questions about your way implementing the loss function based on your paper. According to your paper, the deviation between predicted values and ground-truth values is weighted by a linear function alpha - yi, then square it to donate the error. But in your code K.mean(K.square((y_pred / max_y) - y_true) / (1 - y_true + 0.1)), you just square the numerator not the whole fraction. And also the L2 regularization term you mentioned in your paper is not in the implementation of the loss function. Am I not fully understood?

ERROR

Using Theano backend.
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 "/content/mlnet/model.py", line 26, in ml_net_model
weights = get_weights_vgg16(f, 1)
File "/content/mlnet/model.py", line 14, in get_weights_vgg16
g = f['layer_{}'.format(id)]
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "/usr/local/lib/python2.7/dist-packages/h5py/_hl/group.py", line 177, in getitem
oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'layer_1' doesn't exist)"

I am using keras 1.1.0
Theano 0.9.0
help me

Loading model error

Hi, when I load the model, this error always happens: Layer weight shape (3, 3, 640, 64) not compatible with provided weight shape (64, 3, 3, 3)

How can I fix it?
Thanks

Problem of input shape

I install Theano0.9.0 and keras1.1.0 and test the code in my datasets according to your comand.
But it errors in
Exception: "concat" mode can only merge layers with matching output shapes except for the concat axis. Layer shapes: [(None, 1, 60, 256), (None, 1, 60, 512), (None, 1, 60, 512)]

So i modify the input input_ml_net = Input(shape=(3, img_rows, img_cols)) to input_ml_net = Input(shape=(img_rows, img_cols, 3)), and convert concat_axis=1 to concat_axis=3, the network is correctly constructed:

((None, 480, 640, 3), (None, 480, 640, 3))
((None, 480, 640, 3), (None, 480, 640, 64))
((None, 480, 640, 64), (None, 480, 640, 64))
((None, 480, 640, 64), (None, 240, 320, 64))
((None, 240, 320, 64), (None, 240, 320, 128))
((None, 240, 320, 128), (None, 240, 320, 128))
((None, 240, 320, 128), (None, 120, 160, 128))
((None, 120, 160, 128), (None, 120, 160, 256))
((None, 120, 160, 256), (None, 120, 160, 256))
((None, 120, 160, 256), (None, 120, 160, 256))
((None, 120, 160, 256), (None, 60, 80, 256))
((None, 60, 80, 256), (None, 60, 80, 512))
((None, 60, 80, 512), (None, 60, 80, 512))
((None, 60, 80, 512), (None, 60, 80, 512))
((None, 60, 80, 512), (None, 60, 80, 512))
((None, 60, 80, 512), (None, 60, 80, 512))
((None, 60, 80, 512), (None, 60, 80, 512))
((None, 60, 80, 512), (None, 60, 80, 512))
([(None, 60, 80, 256), (None, 60, 80, 512), (None, 60, 80, 512)], (None, 60, 80, 1280))
((None, 60, 80, 1280), (None, 60, 80, 1280))
((None, 60, 80, 1280), (None, 60, 80, 64))
((None, 60, 80, 64), (None, 60, 80, 1))
((None, 60, 80, 1), (None, 60, 80, 1))
((None, 60, 80, 1), (None, 60, 80, 1))

But it errors in:
Exception: Error when checking : expected input_1 to have shape (None, 480, 640, 3) but got array with shape (1, 3, 480, 640)

Then i comment out ims = ims.transpose((0, 3, 1, 2)) in preprocess_images, and it errors in :

ValueError: Input dimension mis-match. (input[1].shape[1] = %lli, input[%i].shape[%i] = %lli)
Apply node that caused the error: Elemwise{Composite{(i0 * ((i1 + i2) + Abs((i1 + i2))))}}[(0, 1)](TensorConstant{(1, 1, 1, 1) of 0.5}, CorrMM{half, (1, 1), (1, 1)}.0, InplaceDimShuffle{x,0,x,x}.0)

So how to make the code work well?

Best Regards

can't use ratio and frac_ratio together Error

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 = x
T.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

Reproducing results when training using only SALICON dataset

Hi @marcellacornia,

I'm trying to reproduce your results when training using only SALICON dataset and I have a couple of questions.
First of all, the predictions you provide on the SALICON validation set are obtained when the model has only been trained with SALICON?

And the scripts you provide are the ones you used when training only with SALICON or when finetuning with MIT300? If I want to train only with SALICON is there anything I should change to obtain the same results as you? (I'm thinking about the need of using padding the images that maybe it is not necessary (?))

Thank you in advance!

Marta

about your provided weights of ML-Net

Hi marcella:
I wonder know whether the weights of ML-Net you provide is only trained on SALICON or have been fine-tuned on MIT1003.
Thanks for your help!

Getting image heatmap from saliency map and original image

Is there any way to get good heatmap, form saliency map and original image, I am trying blending techniques etc but these are not good , some time face problem of change in scale to blue etc and some time not that much heat over attention points. Saliency map thresolding is main problem. can any one help there

Errors using the pre-trained model

Hi Marcella,
I tried to compute saliency maps using the pre-trained model with the MIT300 benchmark but I have some errors.
I changed the image resolution in the config.py, however I don't know if I need to add anything more.
I don't know if there are problems for specific software versions, I have Anaconda Python 3.5.2 and Keras 1.2.0. And, I changed the backend to Theano already.

Here are the massages I got when I run python main.py test "image_folder"

Load weights ML-Net
Predict saliency maps for C:\Users\Guilherme\Desktop\BenchmarkIMAGES
Exception in thread Thread-37:
Traceback (most recent call last):
File "C:\Program Files\Anaconda3\lib\threading.py", line 914, in _bootstrap_inner
self.run()
File "C:\Program Files\Anaconda3\lib\threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "C:\Program Files\Anaconda3\lib\site-packages\keras\engine\training.py", line 409, in data_generator_task
generator_output = next(generator)
File "main.py", line 36, in generator_test
yield preprocess_images(images[counter:counter + b_s], shape_r, shape_c)
File "C:\Users\Guilherme\Desktop\MLNET\utilities.py", line 36, in preprocess_images
padded_image = padding(original_image, shape_r, shape_c, 3)
File "C:\Users\Guilherme\Desktop\MLNET\utilities.py", line 11, in padding
original_shape = img.shape
AttributeError: 'NoneType' object has no attribute 'shape'

Traceback (most recent call last):
File "main.py", line 71, in
predictions = model.predict_generator(generator_test(b_s=1, imgs_test_path=imgs_test_path), nb_imgs_test)
File "C:\Program Files\Anaconda3\lib\site-packages\keras\engine\training.py", line 1729, in predict_generator
outs = self.predict_on_batch(x)
File "C:\Program Files\Anaconda3\lib\site-packages\keras\engine\training.py", line 1319, in predict_on_batch
self.internal_input_shapes)
File "C:\Program Files\Anaconda3\lib\site-packages\keras\engine\training.py", line 74, in standardize_input_data
'Found: ' + str(data)[:200] + '...')
TypeError: Error when checking : data should be a Numpy array, or list/dict of Numpy arrays. Found: None...

input

Are there any requirements and restrictions on input, this is my mistake:
Traceback (most recent call last):
File "main.py", line 71, in
predictions = model.predict_generator(generator_test(b_s=1, imgs_test_path=imgs_test_path), nb_imgs_test)
File "D:\tools\Anaconda\set\envs\python37tf\lib\site-packages\keras\engine\training.py", line 1662, in predict_generator
outs = self.predict_on_batch(x)
File "D:\tools\Anaconda\set\envs\python37tf\lib\site-packages\keras\engine\training.py", line 1286, in predict_on_batch
self.internal_input_shapes)
File "D:\tools\Anaconda\set\envs\python37tf\lib\site-packages\keras\engine\training.py", line 73, in standardize_input_data
'Found: ' + str(data)[:200] + '...')
Exception: Error when checking : data should be a Numpy array, or list/dict of Numpy arrays. Found: None...

Layer weight shape missmatch

Running the method for test using the provided weights receive the following exception:

Exception: Layer weight shape (3, 3, 640, 64) not compatible with provided weight shape (64, 3, 3, 3)

problem regarding vgg model weights loading

Hi,
I'm trying to run your code in test mode and I get an exception error:
Layer weight shape(3,3,640,64) not compatible with provided weight shape (64,3,3,3)
What could be the problem?

can you provide loss value curve ?

I am trying to reproduce result in PyTorch but loss already start from 10e-2.

class ModMSELoss(torch.nn.Module):
    def __init__(self,shape_r_gt,shape_c_gt):
        super(ModMSELoss, self).__init__()
        self.shape_r_gt = shape_r_gt
        self.shape_c_gt = shape_c_gt
        
    def forward(self, output , label):
        output_max = torch.max(torch.max(output,2)[0],2)[0].unsqueeze(2).unsqueeze(2).expand(output.shape[0],output.shape[1],self.shape_r_gt,self.shape_c_gt)
        loss = torch.mean( ((output / output_max) - label)**2 / (1 - label + 0.1))
        return loss

Menotioned Loss is on training data.

Epcohs:0 Images:500 Loss:0.04258342459797859
Epcohs:0 Images:1000 Loss:0.04922671616077423
Epcohs:0 Images:1500 Loss:0.03176497668027878
Epcohs:0 Images:2000 Loss:0.044319380074739456
Epcohs:0 Images:2500 Loss:0.04123256355524063
Epcohs:0 Images:3000 Loss:0.033859699964523315
Epcohs:0 Images:3500 Loss:0.03699108585715294
Epcohs:0 Images:4000 Loss:0.025232627987861633
Epcohs:0 Images:4500 Loss:0.041686929762363434
Epcohs:0 Images:5000 Loss:0.036925509572029114

Exception: Layer weight shape (3, 3, 640, 64) not compatible with provided weight shape (64, 3, 3, 3)

Hi I read the previous Issues , #1 #7 #2 ,
I am using Google Colab with these packeges installed
python 2.7
theano 0.9.0
and
Keras 1.1.0

These are my Keras.json configs :
{ "epsilon": 1e-07, "floatx": "float32", "image_data_format": "th", "backend": "theano" }.

the issue with the model Loading VGG weights still persists

`Using Theano backend.

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 "/content/mlnet/model.py", line 27, in ml_net_model

conv1_1 = Convolution2D(64, 3, 3, weights=weights, activation='relu', border_mode='same')(input_ml_net)

File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 487, in call
self.build(input_shapes[0])

File "/usr/local/lib/python2.7/dist-packages/keras/layers/convolutional.py", line 437, in build
self.set_weights(self.initial_weights)

File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 889, in set_weights
'provided weight shape ' + str(w.shape))

Exception: Layer weight shape (3, 3, 640, 64) not compatible with provided weight shape (64, 3, 3, 3)
`

how much gpu memory is required?

HI
I tried to train the model with a GTX1080 card(8GB memory),but this error occurred:
.....
Training ML-Net
Epoch 1/20
Traceback (most recent call last):
File "main.py", line 53, in
ModelCheckpoint('weights.mlnet.{epoch:02d}-{val_loss:.4f}.pkl', save_best_only=True)])
File "/usr/local/lib/python2.7/dist-packages/Keras-1.2.2-py2.7.egg/keras/engine/training.py", line 1557, in fit_generator
class_weight=class_weight)
File "/usr/local/lib/python2.7/dist-packages/Keras-1.2.2-py2.7.egg/keras/engine/training.py", line 1320, in train_on_batch
outputs = self.train_function(ins)
File "/usr/local/lib/python2.7/dist-packages/Keras-1.2.2-py2.7.egg/keras/backend/theano_backend.py", line 959, in call
return self.function(*inputs)
File "/usr/local/lib/python2.7/dist-packages/theano/compile/function_module.py", line 871, in call
storage_map=getattr(self.fn, 'storage_map', None))
File "/usr/local/lib/python2.7/dist-packages/theano/gof/link.py", line 314, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "/usr/local/lib/python2.7/dist-packages/theano/compile/function_module.py", line 859, in call
outputs = self.fn()
MemoryError: Error allocating 393216000 bytes of device memory (CNMEM_STATUS_OUT_OF_MEMORY).
Apply node that caused the error: GpuElemwise{add,no_inplace}(GpuElemwise{add,no_inplace}.0, GpuElemwise{Abs,no_inplace}.0)
Toposort index: 575
Inputs types: [CudaNdarrayType(float32, 4D), CudaNdarrayType(float32, 4D)]
Inputs shapes: [(10, 128, 240, 320), (10, 128, 240, 320)]
Inputs strides: [(9830400, 76800, 320, 1), (9830400, 76800, 320, 1)]
Inputs values: ['not shown', 'not shown']
Outputs clients: [[GpuElemwise{mul,no_inplace}(CudaNdarrayConstant{[[[[ 0.5]]]]}, GpuElemwise{add,no_inplace}.0)]]

....
I watched the gpu memory-usage increased to 7.8G(the total memory is 8110M) after i started to train,and then this error occurred.The message above shows "Error allocating 393216000 bytes", does this mean 393M more memory is needed? And which card did you guys use?

How to learn the prior maps in your method?

Hi,
Thanks for your excellent work, here I wanna know about the prior map, actually, maybe you are the first to propose the learned priors, different from the traditional methods which used the hand-crafted prior maps.

However, rather than knowing how to use the prior maps, I'd like to know more about how you get the prior maps. What does the learn mean in learned priors? Is there another network to learn to generate the prior maps? Or is there any ground truth to train the network to produce the prior maps?

Looking forward to your reply!

error

I always get an error when executing: python main.py /image_folder

File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2684)
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2642)
File "/home/nsilva/anaconda2/lib/python2.7/site-packages/h5py/_hl/group.py", line 166, in getitem
oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2684)
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2642)
File "h5py/h5o.pyx", line 190, in h5py.h5o.open (/tmp/pip-4rPeHA-build/h5py/h5o.c:3570)
KeyError: "Unable to open object (Object 'layer_1' doesn't exist)"

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.