xavysp / DexiNed

DexiNed: Dense EXtreme Inception Network for Edge Detection
MIT License
739 stars 157 forks source link

Unable to test on different model than trained model #19

Closed Brainkite closed 4 years ago

Brainkite commented 4 years ago

I trained the model on the BSDS500 dataset and wanted to test it in the BIPED dataset but when use_previous_trained is True the implementation only wants to use a DXN_BIPED checkpoint folder. And if I rename my checkpoint folder to match I get a "not a valid checkpoint error"

[18 May 2020 16h16m33s][INFO]Build model finished: 1.6700s WARNING:tensorflow:From /home/jupyter/repos/DexiNed/test.py:37: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.

[18 May 2020 16h16m34s][ERROR] Error setting up DexiNed traied model, The passed save_path is not a valid checkpoint: checkpoints/DXN_BIPED/train_1/DXN-149736 [18 May 2020 16h16m34s][INFO]Writing PNGs at None Traceback (most recent call last): File "run_model.py", line 131, in main(args=args) File "run_model.py", line 121, in main tester.run(sess) File "/home/jupyter/repos/DexiNed/test.py", line 69, in run im, file_name = get_single_image(self.args,file_path=test_data[i]) File "/home/jupyter/repos/DexiNed/utls/dataset_manager.py", line 1272, in get_single_image h,w,c=img.shape AttributeError: 'NoneType' object has no attribute 'shape'

xavysp commented 4 years ago

Hi maybe this is easy, you are not opening the test image, so to test a dataset you should set the following lines:

    parser.add_argument('--use_dataset', default=True, type=bool) # test: dataset=True single image=FALSE
    parser.add_argument('--test_list', default='test_pair.lst',type=str) # for NYUD&BSDS:test_pair.lst, biped msi_test.lst/test_rgb.lst
    parser.add_argument('--test_dataset', default='BIPED', choices=['BIPED', 'BSDS','MULTICUE','NYUD','PASCAL','CID','DCD'])
    parser.add_argument('--dataset_dir',default="/opt/dataset/",type=str) # default:'/opt/dataset/'

I will set better when I have time,

Let me know it worked for you Cheers,

kandilidinesh commented 4 years ago

@Brainkite Can you share the checkpoint directory tree ?

xavysp commented 4 years ago

@Brainkite Can you share the checkpoint directory tree ?

Yes, please check this issue 14

Brainkite commented 4 years ago

@Brainkite Can you share the checkpoint directory tree ? image

Brainkite commented 4 years ago

Hi maybe this is easy, you are not opening the test image, so to test a dataset you should set the following lines:

    parser.add_argument('--use_dataset', default=True, type=bool) # test: dataset=True single image=FALSE
    parser.add_argument('--test_list', default='test_pair.lst',type=str) # for NYUD&BSDS:test_pair.lst, biped msi_test.lst/test_rgb.lst
    parser.add_argument('--test_dataset', default='BIPED', choices=['BIPED', 'BSDS','MULTICUE','NYUD','PASCAL','CID','DCD'])
    parser.add_argument('--dataset_dir',default="/opt/dataset/",type=str) # default:'/opt/dataset/'

I will set better when I have time,

Let me know it worked for you Cheers,

I used these options but did not resolved the problem: here are the run_model.py parameters:

train config

parser.add_argument('--train_dataset', default='BIPED', choices=['BIPED','BSDS'])
parser.add_argument('--test_dataset', default='BIPED', choices=['BIPED', 'BSDS','MULTICUE','NYUD','PASCAL','CID','DCD'])
parser.add_argument('--dataset_dir',default='/Users/antoninsumner/Datasets',type=str) # default:'/opt/dataset/'
parser.add_argument('--dataset_augmented', default=True,type=bool)
parser.add_argument('--train_list',default='train_rgb.lst', type=str) # BSDS train_pair.lst, SSMIHD train_rgb_pair.lst/train_rgbn_pair.lst
parser.add_argument('--test_list', default='test_rgb.lst',type=str) # for NYUD&BSDS:test_pair.lst, ssmihd: msi_test.lst/vis_test.lst
parser.add_argument('--trained_model_dir', default='train_2',type=str) # 'trainV2_RN'
# SSMIHD_RGBN msi_valid_list.txt and msi_test_list.txt is for unified test
parser.add_argument('--use_nir', default=False, type=bool)
parser.add_argument('--use_dataset', default=True, type=bool) # test: dataset TRUE single image FALSE
# model config
parser.add_argument('--model_state', default='test', choices=['train','test','None']) # always in None
parser.add_argument('--model_name', default='DXN',choices=['DXN','XCP','None'])
parser.add_argument('--use_v1', default=False,type=bool)
parser.add_argument('--model_purpose', default='edges',choices=['edges','restoration','None'])
parser.add_argument('--batch_size_train',default=8,type=int)
parser.add_argument('--batch_size_val',default=8, type=int)
parser.add_argument('--batch_size_test',default=1,type=int)
parser.add_argument('--checkpoint_dir', default='checkpoints',type=str)
parser.add_argument('--logs_dir', default='logs',type=str)
parser.add_argument('--learning_rate',default=1e-4, type=float) # 1e-4=0.0001
parser.add_argument('--lr_scheduler',default=None,choices=[None,'asce','desc']) # check here
parser.add_argument('--learning_rate_decay', default=0.1,type=float)
parser.add_argument('--weight_decay', default=0.0002, type=float)
parser.add_argument('--model_weights_path', default='vgg16_.npy')
parser.add_argument('--train_split', default=0.9, type=float) # default 0.8
parser.add_argument('--max_iterations', default=150000, type=int) # 100000
parser.add_argument('--learning_decay_interval',default=25000, type=int) # 25000
parser.add_argument('--loss_weights', default=1.0, type=float)
parser.add_argument('--save_interval', default=20000, type=int)  # 50000
parser.add_argument('--val_interval', default=30, type=int)
parser.add_argument('--use_subpixel', default=None, type=bool)  # None=upsampling with transp conv
parser.add_argument('--deep_supervision', default=True, type= bool)
parser.add_argument('--target_regression',default=True, type=bool) # true
parser.add_argument('--mean_pixel_values', default=[103.939,116.779,123.68, 137.86], type=float)# [103.939,116.779,123.68]
# for Nir pixels mean [103.939,116.779,123.68, 137.86]
parser.add_argument('--channel_swap', default=[2,1,0], type=int)
parser.add_argument('--gpu-limit',default=1.0, type= float, )
parser.add_argument('--use_trained_model', default=False,type=bool) # for vvg16
parser.add_argument('--use_previous_trained', default=True, type=bool)
# image configuration
parser.add_argument('--image_width', default=1280, type=int) # 480 NYUD=560 BIPED=1280 default 400 other 448
parser.add_argument('--image_height', default=720, type=int) # 480 for NYUD 425 BIPED=720 default 400
parser.add_argument('--n_channels', default=3, type=int) # last ssmihd_xcp trained in 512
# test config
parser.add_argument('--test_snapshot', default=149736, type=int) #  BIPED: 149736 BSDS:101179
#DexiNedv1=149736,DexiNedv2=149999
parser.add_argument('--testing_threshold', default=0.0, type=float)
parser.add_argument('--base_dir_results',default=None,type=str) # default: '/opt/results/edges'

But I still get the error: Error setting up DexiNed traied model, The passed save_path is not a valid checkpoint: checkpoints/DXN_BIPED/train_2/DXN-149736

Full Error log:

WARNING:tensorflow: The TensorFlow contrib module will not be included in TensorFlow 2.0. For more information, please see:

WARNING:tensorflow:From run_model.py:80: The name tf.GPUOptions is deprecated. Please use tf.compat.v1.GPUOptions instead.

WARNING:tensorflow:From run_model.py:85: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

WARNING:tensorflow:From run_model.py:85: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

2020-05-21 15:25:21.311740: I tensorflow/core/platform/cpu_feature_guard.cc:145] This TensorFlow binary is optimized with Intel(R) MKL-DNN to use the following CPU instructions in performance critical operations: SSE4.1 SSE4.2 AVX To enable them in non-MKL-DNN operations, rebuild TensorFlow with the appropriate compiler flags. 2020-05-21 15:25:21.312451: I tensorflow/core/common_runtime/process_util.cc:115] Creating new thread pool with default inter op setting: 8. Tune using inter_op_parallelism_threads for best performance. WARNING:tensorflow:From /Users/antoninsumner/Documents/GitHub/DexiNed/models/dexined.py:30: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING:tensorflow:From /Users/antoninsumner/Documents/GitHub/DexiNed/models/dexined.py:48: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.

WARNING:tensorflow:From /Users/antoninsumner/Documents/GitHub/DexiNed/models/dexined.py:53: conv2d (from tensorflow.python.layers.convolutional) is deprecated and will be removed in a future version. Instructions for updating: Use tf.keras.layers.Conv2D instead. WARNING:tensorflow:From /opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/layers/convolutional.py:424: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version. Instructions for updating: Please use layer.__call__ method instead. WARNING:tensorflow:From /Users/antoninsumner/Documents/GitHub/DexiNed/models/dexined.py:297: conv2d_transpose (from tensorflow.python.layers.convolutional) is deprecated and will be removed in a future version. Instructions for updating: Use tf.keras.layers.Conv2DTranspose instead. [21 May 2020 15h25m23s][INFO]Build model finished: 2.2905s WARNING:tensorflow:From /Users/antoninsumner/Documents/GitHub/DexiNed/test.py:37: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.

[21 May 2020 15h25m23s][ERROR] Error setting up DexiNed traied model, The passed save_path is not a valid checkpoint: checkpoints/DXN_BIPED/train_2/DXN-149736 [21 May 2020 15h25m23s][INFO] Enterely testing set-up from /Users/antoninsumner/Datasets/BIPED/edges/test_rgb.lst, size: 50 [21 May 2020 15h25m23s][INFO]testing set-up from /Users/antoninsumner/Datasets/BIPED/edges/test_rgb.lst, size: 50 [21 May 2020 15h25m23s][INFO]Writing PNGs at None Traceback (most recent call last): File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call return fn(*args) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn target_list, run_metadata) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value Xpt/conv2_block61/kernel [[{{node Xpt/conv2_block61/kernel/read}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run_model.py", line 131, in main(args=args) File "run_model.py", line 121, in main tester.run(sess) File "/Users/antoninsumner/Documents/GitHub/DexiNed/test.py", line 61, in run edgemap = session.run(self.model.predictions, feed_dict={self.model.images: [im]}) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 956, in run run_metadata_ptr) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1180, in _run feed_dict_tensor, options, run_metadata) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run run_metadata) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value Xpt/conv2_block61/kernel [[node Xpt/conv2_block61/kernel/read (defined at /opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py:1748) ]]

Original stack trace for 'Xpt/conv2_block61/kernel/read': File "run_model.py", line 131, in main(args=args) File "run_model.py", line 120, in main tester.setup(sess) File "/Users/antoninsumner/Documents/GitHub/DexiNed/test.py", line 20, in setup self.model = dexined(self.args) File "/Users/antoninsumner/Documents/GitHub/DexiNed/models/dexined.py", line 37, in init self.define_model() File "/Users/antoninsumner/Documents/GitHub/DexiNed/models/dexined.py", line 234, in define_model kernel_initializer=weight_init) # bx25x25x256 File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/util/deprecation.py", line 324, in new_func return func(*args, kwargs) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/layers/convolutional.py", line 424, in conv2d return layer.apply(inputs) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/util/deprecation.py", line 324, in new_func return func(*args, *kwargs) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 1700, in apply return self.call(inputs, args, kwargs) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/layers/base.py", line 548, in call outputs = super(Layer, self).call(inputs, *args, kwargs) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 824, in call self._maybe_build(inputs) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 2146, in _maybe_build self.build(input_shapes) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/keras/layers/convolutional.py", line 165, in build dtype=self.dtype) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/layers/base.py", line 461, in add_weight kwargs) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 529, in add_weight aggregation=aggregation) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/training/tracking/base.py", line 712, in _add_variable_with_custom_getter kwargs_for_getter) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/variable_scope.py", line 1500, in get_variable aggregation=aggregation) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/variable_scope.py", line 1243, in get_variable aggregation=aggregation) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/variable_scope.py", line 567, in get_variable aggregation=aggregation) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/variable_scope.py", line 519, in _true_getter aggregation=aggregation) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/variable_scope.py", line 933, in _get_single_variable aggregation=aggregation) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/variables.py", line 258, in call return cls._variable_v1_call(*args, kwargs) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/variables.py", line 219, in _variable_v1_call shape=shape) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/variables.py", line 197, in previous_getter = lambda kwargs: default_variable_creator(None, *kwargs) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/variable_scope.py", line 2519, in default_variable_creator shape=shape) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/variables.py", line 262, in call return super(VariableMetaclass, cls).call(args, kwargs) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/variables.py", line 1688, in init shape=shape) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/variables.py", line 1872, in _init_from_args self._snapshot = array_ops.identity(self._variable, name="read") File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/util/dispatch.py", line 180, in wrapper return target(*args, *kwargs) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/array_ops.py", line 203, in identity ret = gen_array_ops.identity(input, name=name) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/ops/gen_array_ops.py", line 4239, in identity "Identity", input=input, name=name) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper op_def=op_def) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func return func(args, **kwargs) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op attrs, op_def, compute_device) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal op_def=op_def) File "/opt/miniconda3/envs/tf/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 1748, in init self._traceback = tf_stack.extract_stack()

Brainkite commented 4 years ago

@Brainkite Can you share the checkpoint directory tree ?

Yes, please check this issue 14

Ok, should I re-order the checkpoint folder as you said? what TF version should I Use, currently I use 1.15

xavysp commented 4 years ago

parser.add_argument('--train_dataset', default='BIPED', choices=['BIPED','BSDS']) parser.add_argument('--test_dataset', default='BIPED', choices=['BIPED', 'BSDS','MULTICUE','NYUD','PASCAL','CID','DCD']) parser.add_argument('--dataset_dir',default='/Users/antoninsumner/Datasets',type=str) # default:'/opt/dataset/' parser.add_argument('--dataset_augmented', default=True,type=bool) parser.add_argument('--train_list',default='train_rgb.lst', type=str) # BSDS train_pair.lst, SSMIHD train_rgb_pair.lst/train_rgbn_pair.lst parser.add_argument('--test_list', default='test_rgb.lst',type=str) # for NYUD&BSDS:test_pair.lst, ssmihd: msi_test.lst/vis_test.lst parser.add_argument('--trained_model_dir', default='train_2',type=str) # 'trainV2_RN'

SSMIHD_RGBN msi_valid_list.txt and msi_test_list.txt is for unified test

parser.add_argument('--use_nir', default=False, type=bool) parser.add_argument('--use_dataset', default=True, type=bool) # test: dataset TRUE single image FALSE

model config

parser.add_argument('--model_state', default='test', choices=['train','test','None']) # always in None parser.add_argument('--model_name', default='DXN',choices=['DXN','XCP','None']) parser.add_argument('--use_v1', default=False,type=bool) parser.add_argument('--model_purpose', default='edges',choices=['edges','restoration','None']) parser.add_argument('--batch_size_train',default=8,type=int) parser.add_argument('--batch_size_val',default=8, type=int) parser.add_argument('--batch_size_test',default=1,type=int) parser.add_argument('--checkpoint_dir', default='checkpoints',type=str) parser.add_argument('--logs_dir', default='logs',type=str) parser.add_argument('--learning_rate',default=1e-4, type=float) # 1e-4=0.0001 parser.add_argument('--lr_scheduler',default=None,choices=[None,'asce','desc']) # check here parser.add_argument('--learning_rate_decay', default=0.1,type=float) parser.add_argument('--weight_decay', default=0.0002, type=float) parser.add_argument('--model_weightspath', default='vgg16.npy') parser.add_argument('--train_split', default=0.9, type=float) # default 0.8 parser.add_argument('--max_iterations', default=150000, type=int) # 100000 parser.add_argument('--learning_decay_interval',default=25000, type=int) # 25000 parser.add_argument('--loss_weights', default=1.0, type=float) parser.add_argument('--save_interval', default=20000, type=int) # 50000 parser.add_argument('--val_interval', default=30, type=int) parser.add_argument('--use_subpixel', default=None, type=bool) # None=upsampling with transp conv parser.add_argument('--deep_supervision', default=True, type= bool) parser.add_argument('--target_regression',default=True, type=bool) # true parser.add_argument('--mean_pixel_values', default=[103.939,116.779,123.68, 137.86], type=float)# [103.939,116.779,123.68]

for Nir pixels mean [103.939,116.779,123.68, 137.86]

parser.add_argument('--channel_swap', default=[2,1,0], type=int) parser.add_argument('--gpu-limit',default=1.0, type= float, ) parser.add_argument('--use_trained_model', default=False,type=bool) # for vvg16 parser.add_argument('--use_previous_trained', default=True, type=bool)

image configuration

parser.add_argument('--image_width', default=1280, type=int) # 480 NYUD=560 BIPED=1280 default 400 other 448 parser.add_argument('--image_height', default=720, type=int) # 480 for NYUD 425 BIPED=720 default 400 parser.add_argument('--n_channels', default=3, type=int) # last ssmihd_xcp trained in 512

test config

parser.add_argument('--test_snapshot', default=149736, type=int) # BIPED: 149736 BSDS:101179

DexiNedv1=149736,DexiNedv2=149999

parser.add_argument('--testing_threshold', default=0.0, type=float) parser.add_argument('--base_dir_results',default=None,type=str) # default: '/opt/results/edges'

Hi sorry I am a little busy. My train configuration will be like:

parser.add_argument('--train_dataset', default='BSDS', choices=['BIPED','BSDS']) # if you are training on BSDS so the train dataset should be BSDS
parser.add_argument('--test_dataset', default='BSDS', choices=['BIPED', 'BSDS','MULTICUE','NYUD','PASCAL','CID','DCD']) # during training it take 10% of BSDS so BSDS
parser.add_argument('--dataset_dir',default='/Users/antoninsumner/Datasets',type=str) # default:'/opt/dataset/'
parser.add_argument('--dataset_augmented', default=True,type=bool)
parser.add_argument('--train_list',default='train_rgb.lst', type=str) # BSDS train_pair.lst, SSMIHD train_rgb_pair.lst/train_rgbn_pair.lst
parser.add_argument('--test_list', default='test_rgb.lst',type=str) # for NYUD&BSDS:test_pair.lst, ssmihd: msi_test.lst/vis_test.lst
parser.add_argument('--trained_model_dir', default='train_2',type=str) # the last checkpoint is into train_2 and the test_snapshot should be 149999 (for testing)
# SSMIHD_RGBN msi_valid_list.txt and msi_test_list.txt is for unified test
parser.add_argument('--use_nir', default=False, type=bool)
parser.add_argument('--use_dataset', default=True, type=bool) # test: dataset TRUE single image FALSE
# model config
parser.add_argument('--model_state', default='train', choices=['train','test','None']) # always in None
parser.add_argument('--model_name', default='DXN',choices=['DXN','XCP','None'])
parser.add_argument('--use_v1', default=False,type=bool)
parser.add_argument('--model_purpose', default='edges',choices=['edges','restoration','None'])
parser.add_argument('--batch_size_train',default=8,type=int)
parser.add_argument('--batch_size_val',default=8, type=int)
parser.add_argument('--batch_size_test',default=1,type=int)
parser.add_argument('--checkpoint_dir', default='checkpoints',type=str)
parser.add_argument('--logs_dir', default='logs',type=str)
parser.add_argument('--learning_rate',default=1e-4, type=float) # 1e-4=0.0001
parser.add_argument('--lr_scheduler',default=None,choices=[None,'asce','desc']) # check here
parser.add_argument('--learning_rate_decay', default=0.1,type=float)
parser.add_argument('--weight_decay', default=0.0002, type=float)
parser.add_argument('--model_weights_path', default='vgg16_.npy')
parser.add_argument('--train_split', default=0.9, type=float) # default 0.8
parser.add_argument('--max_iterations', default=150000, type=int) # 100000
parser.add_argument('--learning_decay_interval',default=25000, type=int) # 25000
parser.add_argument('--loss_weights', default=1.0, type=float)
parser.add_argument('--save_interval', default=20000, type=int)  # 50000
parser.add_argument('--val_interval', default=30, type=int)
parser.add_argument('--use_subpixel', default=None, type=bool)  # None=upsampling with transp conv
parser.add_argument('--deep_supervision', default=True, type= bool)
parser.add_argument('--target_regression',default=True, type=bool) # true
parser.add_argument('--mean_pixel_values', default=[103.939,116.779,123.68, 137.86], type=float)# [103.939,116.779,123.68]
# for Nir pixels mean [103.939,116.779,123.68, 137.86]
parser.add_argument('--channel_swap', default=[2,1,0], type=int)
parser.add_argument('--gpu-limit',default=1.0, type= float, )
parser.add_argument('--use_trained_model', default=False,type=bool) # for vvg16
parser.add_argument('--use_previous_trained', default=True, type=bool)
# image configuration
parser.add_argument('--image_width', default=400, type=int) # 480 NYUD=560 BIPED=1280 default 400 other 448
parser.add_argument('--image_height', default=400, type=int) # 480 for NYUD 425 BIPED=720 default 400
parser.add_argument('--n_channels', default=3, type=int) # last ssmihd_xcp trained in 512
# test config
parser.add_argument('--test_snapshot', default=None, type=int) #  BIPED: 149736 BSDS:101179
#DexiNedv1=149736,DexiNedv2=149999
parser.add_argument('--testing_threshold', default=0.0, type=float)
parser.add_argument('--base_dir_results',default=None,type=str) # default: '/opt/results/edges'

while training image_width and height are the same size 400, and test_snapshot is None to train from scratch. I trained in tensorflow 1.13.1, and I did the last prediction (test) 1.15.2.

The parser has some of the unused arguments, I will clean this part. If you are familiar with Pytorch you can use DexiNed-Pytorch. Yes, I need to clean the data managing part sorry :(

Xavier

Brainkite commented 4 years ago

Okay, I wend on implementing Dexined reusing only model.py from the PyTorch implementation. I just have 2 questions: QUESTION_1: The model outputs a list of 7 edge_maps. In the paper, you mention a "fused" (DexiNed-f) version and an "averaged" (Dexined-a) version of the model. Does "fused" refers to the summation of all 7 outputs and "averaged" the average?

QUESTION_2: You talk about initializing the weight of each fusion layer to 1/N-1 (4.4. Implementation Notes). It seems that in the pytorch implementation those weights are initialized to 1/bs (bs=batch_size) image Am I right? Unless I missunderstood this part of the paper.

xavysp commented 4 years ago

Okay, I wend on implementing Dexined reusing only model.py from the PyTorch implementation. I just have 2 questions: QUESTION_1: The model outputs a list of 7 edge_maps. In the paper, you mention a "fused" (DexiNed-f) version and an "averaged" (Dexined-a) version of the model. Does "fused" refers to the summation of all 7 outputs and "averaged" the average?

Actually no, Dexined-f is the in-model fused edge-map, and Dexined-a is the average of all outputs (7 outputs).

QUESTION_2: You talk about initializing the weight of each fusion layer to 1/N-1 (4.4. Implementation Notes). It seems that in the pytorch implementation those weights are initialized to 1/bs (bs=batch_size)

If you go to line 426 main.py you will find 0.2 which is 1/N-1 cheers.

image Am I right? Unless I missunderstood this part of the paper.

Brainkite commented 4 years ago

Ok great thank you! How do you set the weights of each scale for the loss function? In the pytorch implementation, all weights are the same. image

Also how do you compute the metrics in the paper ODS, OIS and AP?

xavysp commented 4 years ago

Ok great thank you! How do you set the weights of each scale for the loss function? In the pytorch implementation, all weights are the same. image

Also how do you compute the metrics in the paper ODS, OIS, and AP?

In this case, the weights are the same 1.0, we did not test with different weights.

Whi respect to the quantitative evaluation you can find in this #8