Giter Site home page Giter Site logo

nldf's Introduction

Non-Local Deep Features for Salient Object Detection

This repository contains the code of the paper:

Luo Z, Mishra A, Achkar A, Eichel J, Li S-Z, Jodoin P-M, “Non-Local Deep Features for Salient Object Detection”, IEEE Conference on Computer Vision and Pattern Recognition (CVPR 2017)

The pre-train model and saliency map can be download at the project page.

https://sites.google.com/view/zhimingluo/nldf

The npy file the VGG-16 can be download at this link: https://github.com/machrisaa/tensorflow-vgg

nldf's People

Contributors

zhimingluo 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

Watchers

 avatar  avatar  avatar  avatar

nldf's Issues

loss变为NAN

您好!我将您代码中的网络结构简化为以下代码:
self.pool5_conv1 = self.Conv_2d(vgg.pool5, [3, 3, 512, 128], 0.01, padding='SAME', name='c1_')
self.contrast_1 = self.Contrast_Layer(self.pool5_conv1, 3)
self.pool5_conv2 = self.Conv_2d(tf.concat([self.pool5_conv1, self.contrast_1], axis=3), [3, 3, 256, 256], 0.01, padding='SAME', name='c2_')
self.pool5_conv3 = self.Conv_2d(self.pool5_conv2, [1, 1, 256, 2], 0.01, padding='SAME', name='c3_')
self.Score = tf.nn.conv2d_transpose(self.pool5_conv3, self.bilinear_upsample_weights(16, 2), output_shape=[1, 176, 176, 2], strides=[1, 16, 16, 1])
然后loss下降到0.32左右时,Loss就会变为NAN。(loss是边缘损失和交叉熵的和)
但是我运行你的网络结构时并不会出现NAN的问题,loss能降到很低。降低学习率我已经试了,然而并不行。
请问我应该如何解决这个问题呢?

Crash while training

Hi,

I'm trying to train my own model according to your implementation.
Since I encounter some gradient error cause Nan or Inf error.

Below is the log when training crash

2018-10-31 02:12:13.561786: E tensorflow/core/kernels/check_numerics_op.cc:185] abnormal_detected_host @0x7fa89e206200 = {1, 0} Found Inf or NaN global norm.
Traceback (most recent call last):
  File "TrainingModel.py", line 112, in <module>
    model.label_holder: label_flip})
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 887, in run
    run_metadata_ptr)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1110, in _run
    feed_dict_tensor, options, run_metadata)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1286, in _do_run
    run_metadata)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1308, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Found Inf or NaN global norm. : Tensor had NaN values
     [[{{node VerifyFinite/CheckNumerics}} = CheckNumerics[T=DT_FLOAT, message="Found Inf or NaN global norm.", _device="/job:localhost/replica:0/task:0/device:GPU:0"](global_norm/global_norm)]]

Caused by op u'VerifyFinite/CheckNumerics', defined at:
  File "TrainingModel.py", line 42, in <module>
    grads, _ = tf.clip_by_global_norm(tf.gradients(model.Loss_Mean, tvars), max_grad_norm)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/clip_ops.py", line 259, in clip_by_global_norm
    "Found Inf or NaN global norm.")
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/numerics.py", line 45, in verify_tensor_all_finite
    verify_input = array_ops.check_numerics(t, message=msg)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 817, in check_numerics
    "CheckNumerics", tensor=tensor, message=message, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/deprecation.py", line 488, in new_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 3272, in create_op
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1768, in __init__
    self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Found Inf or NaN global norm. : Tensor had NaN values
     [[{{node VerifyFinite/CheckNumerics}} = CheckNumerics[T=DT_FLOAT, message="Found Inf or NaN global norm.", _device="/job:localhost/replica:0/task:0/device:GPU:0"](global_norm/global_norm)]]

Could you help to comment about it.
I also wonder the tensorflow version or more detail for training environment of pre-build model.

Thanks.

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.