Hi! And thank you for making this code available. I am trying to run the demo code using the command:
python demo.py --gpu 1 --epoch 10
I have downloaded the three files from the models links and put them in outout/models
I get the following errors:
04-27 14:34:19 CRI: Load nothing. There is no model in path /data0/BP4D/output\models\snapshot_10.ckpt.
E0427 14:34:19.535481 14412 logger.py:46] CRITICAL - CRI: Load nothing. There is no model in path /data0/BP4D/output\models\snapshot_10.ckpt.
Where am i going wrong here? do i need to hardcode the model path?
the full trace is below.
Thanks!
python demo.py --gpu 1 --epoch 10
WARNING: Logging before flag parsing goes to stderr.
W0427 14:34:17.884148 14412 lazy_loader.py:50]
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
* https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
* https://github.com/tensorflow/addons
* https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.
W0427 14:34:17.955076 14412 module_wrapper.py:139] From D:\Vice\FAU\FAU-master\lib\base.py:107: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.
W0427 14:34:17.956074 14412 module_wrapper.py:139] From D:\Vice\FAU\FAU-master\lib\base.py:109: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.
2020-04-27 14:34:17.963765: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
W0427 14:34:17.982058 14412 module_wrapper.py:139] From D:\Vice\FAU\FAU-master\lib\base.py:128: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.
W0427 14:34:17.982058 14412 module_wrapper.py:139] From D:\Vice\FAU\FAU-master\lib\base.py:353: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.
W0427 14:34:17.983057 14412 module_wrapper.py:139] From D:\Vice\FAU\FAU-master\lib\base.py:353: The name tf.get_variable_scope is deprecated. Please use tf.compat.v1.get_variable_scope instead.
W0427 14:34:17.984055 14412 module_wrapper.py:139] From D:\ice\FAU\FAU-master\model_graph.py:131: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
W0427 14:34:17.994045 14412 deprecation.py:323] From D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\layers\python\layers\layers.py:1057: 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.
W0427 14:34:19.232768 14412 deprecation.py:506] From D:\\Vice\FAU\FAU-master\model_graph.py:32: calling reduce_sum_v1 (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
W0427 14:34:19.279742 14412 deprecation.py:506] From D:\\Vice\FAU\FAU-master\model_graph.py:43: calling reduce_max_v1 (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
04-27 14:34:19 CRI: Load nothing. There is no model in path /data0/BP4D/output\models\snapshot_10.ckpt.
E0427 14:34:19.535481 14412 logger.py:46] CRITICAL - CRI: Load nothing. There is no model in path /data0/BP4D/output\models\snapshot_10.ckpt.
Traceback (most recent call last):
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\client\session.py", line 1365, in _do_call
return fn(*args)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\client\session.py", line 1350, in _run_fn
target_list, run_metadata)
File "D:\\Deep\Python3.7\lib\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 resnet_v1_50/conv1/BatchNorm/moving_variance
[[{{node resnet_v1_50/conv1/BatchNorm/moving_variance/read}}]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "demo.py", line 54, in <module>
main()
File "demo.py", line 32, in main
test(int(args.epoch))
File "demo.py", line 51, in test
result = test_net(tester, data)
File "demo.py", line 44, in test_net
heatmap = tester.predict_one([imgs],batch_id)[0]
File "D:\\Vice\FAU\FAU-master\lib\base.py", line 382, in predict_one
res = self.sess.run([*self.graph_ops, *self.summary_dict.values()], feed_dict=feed_dict)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\client\session.py", line 956, in run
run_metadata_ptr)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\client\session.py", line 1180, in _run
feed_dict_tensor, options, run_metadata)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\client\session.py", line 1359, in _do_run
run_metadata)
File "D:\\Deep\Python3.7\lib\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 resnet_v1_50/conv1/BatchNorm/moving_variance
[[node resnet_v1_50/conv1/BatchNorm/moving_variance/read (defined at D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\framework\ops.py:1748) ]]
Original stack trace for 'resnet_v1_50/conv1/BatchNorm/moving_variance/read':
File "demo.py", line 54, in <module>
main()
File "demo.py", line 32, in main
test(int(args.epoch))
File "demo.py", line 49, in test
tester = Tester(Model_graph(), cfg)
File "D:\\Vice\FAU\FAU-master\lib\base.py", line 309, in __init__
super(Tester, self).__init__(net, cfg, data_iter, log_name='test_logs.txt')
File "D:\\Vice\FAU\FAU-master\lib\base.py", line 112, in __init__
self.build_graph()
File "D:\\Vice\FAU\FAU-master\lib\base.py", line 129, in build_graph
self.graph_ops = self._make_graph()
File "D:\\Vice\FAU\FAU-master\lib\base.py", line 357, in _make_graph
self.net.make_network(is_train=False)
File "D:\\Vice\FAU\FAU-master\model_graph.py", line 134, in make_network
resnet_fms = backbone(image, is_train, bn_trainable=True)
File "D:\\Vice\FAU\FAU-master\lib\basemodel.py", line 57, in resnet50
tf.concat(inp,axis=3), 64, 7, stride=2, scope='conv1')
File "D:\\Vice\FAU\FAU-master\lib\resnet_utils.py", line 148, in conv2d_same
scope=scope)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\framework\python\ops\arg_scope.py", line 182, in func_with_args
return func(*args, **current_args)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\layers\python\layers\layers.py", line 1159, in convolution2d
conv_dims=2)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\framework\python\ops\arg_scope.py", line 182, in func_with_args
return func(*args, **current_args)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\layers\python\layers\layers.py", line 1066, in convolution
outputs = normalizer_fn(outputs, **normalizer_params)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\framework\python\ops\arg_scope.py", line 182, in func_with_args
return func(*args, **current_args)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\layers\python\layers\layers.py", line 650, in batch_norm
outputs = layer.apply(inputs, training=is_training)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\util\deprecation.py", line 324, in new_func
return func(*args, **kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 1700, in apply
return self.__call__(inputs, *args, **kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\layers\base.py", line 548, in __call__
outputs = super(Layer, self).__call__(inputs, *args, **kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 824, in __call__
self._maybe_build(inputs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 2146, in _maybe_build
self.build(input_shapes)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\keras\layers\normalization.py", line 411, in build
experimental_autocast=False)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\layers\base.py", line 461, in add_weight
**kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 529, in add_weight
aggregation=aggregation)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\training\tracking\base.py", line 712, in _add_variable_with_custom_getter
**kwargs_for_getter)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variable_scope.py", line 1500, in get_variable
aggregation=aggregation)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variable_scope.py", line 1243, in get_variable
aggregation=aggregation)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variable_scope.py", line 550, in get_variable
return custom_getter(**custom_getter_kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variable_scope.py", line 1956, in wrapped_custom_getter
return custom_getter(functools.partial(old_getter, getter), *args, **kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\layers\python\layers\layers.py", line 1761, in layer_variable_getter
return _model_variable_getter(getter, *args, **kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\layers\python\layers\layers.py", line 1752, in _model_variable_getter
aggregation=aggregation)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\framework\python\ops\arg_scope.py", line 182, in func_with_args
return func(*args, **current_args)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\framework\python\ops\variables.py", line 351, in model_variable
aggregation=aggregation)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\framework\python\ops\arg_scope.py", line 182, in func_with_args
return func(*args, **current_args)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\framework\python\ops\variables.py", line 281, in variable
aggregation=aggregation)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\layers\python\layers\layers.py", line 1761, in layer_variable_getter
return _model_variable_getter(getter, *args, **kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\layers\python\layers\layers.py", line 1752, in _model_variable_getter
aggregation=aggregation)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\framework\python\ops\arg_scope.py", line 182, in func_with_args
return func(*args, **current_args)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\framework\python\ops\variables.py", line 351, in model_variable
aggregation=aggregation)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\framework\python\ops\arg_scope.py", line 182, in func_with_args
return func(*args, **current_args)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\contrib\framework\python\ops\variables.py", line 281, in variable
aggregation=aggregation)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variable_scope.py", line 519, in _true_getter
aggregation=aggregation)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variable_scope.py", line 933, in _get_single_variable
aggregation=aggregation)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variables.py", line 258, in __call__
return cls._variable_v1_call(*args, **kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variables.py", line 219, in _variable_v1_call
shape=shape)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variables.py", line 197, in <lambda>
previous_getter = lambda **kwargs: default_variable_creator(None, **kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variable_scope.py", line 2519, in default_variable_creator
shape=shape)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variables.py", line 262, in __call__
return super(VariableMetaclass, cls).__call__(*args, **kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variables.py", line 1688, in __init__
shape=shape)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\variables.py", line 1872, in _init_from_args
self._snapshot = array_ops.identity(self._variable, name="read")
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\util\dispatch.py", line 180, in wrapper
return target(*args, **kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\array_ops.py", line 203, in identity
ret = gen_array_ops.identity(input, name=name)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\ops\gen_array_ops.py", line 4238, in identity
"Identity", input=input, name=name)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\framework\op_def_library.py", line 794, in _apply_op_helper
op_def=op_def)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\util\deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3357, in create_op
attrs, op_def, compute_device)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3426, in _create_op_internal
op_def=op_def)
File "D:\\Deep\Python3.7\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1748, in __init__
self._traceback = tf_stack.extract_stack()