Repository navigation
Closed
Labels
howtousedlcissue regarding the use of DeepLabCut
Description
Is there an existing issue for this?
- I have searched the existing issues
Bug description
Multi animal project. Training went fine, evaluation looks ok. 3 animals are expected in an example video I want to analyze.
When trying to start a video analysis run through the GUI (see screenshot below), I run into errors, the video does not get analyzed. I added the traceback below.
see log below.
Operating System
Win 10
DeepLabCut version
DLC 2.3.5
DeepLabCut mode
multi animal
Device type
NVIDIA GeForce RTX 3070 Ti
Steps To Reproduce
No response
Relevant log output
2023-07-19 09:40:04.24417
0: W tensorflow/core/common_runtime/bfc_allocator.cc:491] *************************************________**********************************_____________________
2023-07-19 09:40:04.244213: W tensorflow/core/framework/op_kernel.cc:1780] OP_REQUIRES failed at fused_batch_norm_op.cc:1356 : RESOURCE_EXHAUSTED: OOM when allocating tensor with shape[8,486,486,256] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
Traceback (most recent call last):
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\client\session.py", line 1378, in _do_call
return fn(*args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\client\session.py", line 1361, in _run_fn return self._call_tf_sessionrun(options, feed_dict, fetch_list,
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\client\session.py", line 1454, in _call_tf_sessionrun
return tf_session.TF_SessionRun_wrapper(self._session, options, feed_dict,
tensorflow.python.framework.errors_impl.ResourceExhaustedError: 2 root error(s) found.
(0) RESOURCE_EXHAUSTED: OOM when allocating tensor with shape[8,486,486,256] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[{{node resnet_v1_50/block1/unit_1/bottleneck_v1/conv3/BatchNorm/FusedBatchNormV3}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info. This isn't available when running in Eager mode.
[[Sigmoid/_549]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info. This isn't available when running in Eager mode.
(1) RESOURCE_EXHAUSTED: OOM when allocating tensor with shape[8,486,486,256] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[{{node resnet_v1_50/block1/unit_1/bottleneck_v1/conv3/BatchNorm/FusedBatchNormV3}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info. This isn't available when running in Eager mode.
0 successful operations.
0 derived errors ignored.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\code\deeplabcut\deeplabcut\gui\utils.py", line 22, in run
self.func()
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\predict_videos.py", line 626, in analyze_videos
AnalyzeMultiAnimalVideo(
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\predict_multianimal.py", line 172, in AnalyzeMultiAnimalVideo
PredicteData, nframes = GetPoseandCostsF(
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\predict_multianimal.py", line 425, in GetPoseandCostsF
D = predict.predict_batched_peaks_and_costs(
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\core\predict_multianimal.py", line 218, in predict_batched_peaks_and_costs
scmaps, locrefs, *pafs, peaks = sess.run(outputs, feed_dict={inputs: images_batch})
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\client\session.py", line 968, in run
result = self._run(None, fetches, feed_dict, options_ptr,
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\client\session.py", line 1191, in _run
results = self._do_run(handle, final_targets, final_fetches,
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\client\session.py", line 1371, in _do_run return self._do_call(_run_fn, feeds, fetches, targets, options,
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\client\session.py", line 1397, in _do_call
raise type(e)(node_def, op, message) # pylint: disable=no-value-for-parameter
tensorflow.python.framework.errors_impl.ResourceExhaustedError: Graph execution error:
Detected at node 'resnet_v1_50/block1/unit_1/bottleneck_v1/conv3/BatchNorm/FusedBatchNormV3' defined at (most recent call last):
File "c:\code\deeplabcut\deeplabcut\gui\utils.py", line 22, in run
self.func()
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\predict_videos.py", line 606, in analyze_videos
sess, inputs, outputs = predict.setup_pose_prediction(
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\core\predict.py", line 26, in setup_pose_prediction
net_heads = PoseNetFactory.create(cfg).test(inputs)
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\nnets\base.py", line 85, in test
heads = self.get_net(inputs)
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\nnets\resnet.py", line 79, in get_net
net, end_points = self.extract_features(inputs)
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\nnets\resnet.py", line 41, in extract_features
net, end_points = net_fun(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\nets\resnet_v1.py", line 270, in resnet_v1_50
return resnet_v1(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\nets\resnet_v1.py", line 212, in resnet_v1
net = resnet_utils.stack_blocks_dense(net, blocks, output_stride)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\nets\resnet_utils.py", line 219, in stack_blocks_dense
net = block.unit_fn(net, rate=1, **unit)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\nets\resnet_v1.py", line 125, in bottleneck
residual = layers.conv2d(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\layers\layers.py", line 1171, in convolution2d
return convolution(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\layers\layers.py", line 1098, in convolution
outputs = normalizer_fn(outputs, **normalizer_params)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\layers\layers.py", line 684, in batch_norm
outputs = layer.apply(inputs, training=is_training)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\legacy_tf_layers\base.py", line 244, in apply
return self(*args, **kwargs)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\legacy_tf_layers\base.py", line 622, in __call__
outputs = super().__call__(inputs, *args, **kwargs)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\engine\base_layer_v1.py", line 838, in __call__
outputs = call_fn(cast_inputs, *args, **kwargs)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\legacy_tf_layers\normalization.py", line 237, in call
return super().call(inputs, training=training)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\layers\normalization\batch_normalization.py", line 850, in call
outputs = self._fused_batch_norm(inputs, training=training)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\layers\normalization\batch_normalization.py", line 660, in _fused_batch_norm
output, mean, variance = control_flow_util.smart_cond(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\utils\control_flow_util.py", line 108, in smart_cond
return tf.__internal__.smart_cond.smart_cond(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\layers\normalization\batch_normalization.py", line 649, in _fused_batch_norm_inference
return tf.compat.v1.nn.fused_batch_norm(
Node: 'resnet_v1_50/block1/unit_1/bottleneck_v1/conv3/BatchNorm/FusedBatchNormV3'
Detected at node 'resnet_v1_50/block1/unit_1/bottleneck_v1/conv3/BatchNorm/FusedBatchNormV3' defined at (most recent call last):
File "c:\code\deeplabcut\deeplabcut\gui\utils.py", line 22, in run
self.func()
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\predict_videos.py", line 606, in analyze_videos
sess, inputs, outputs = predict.setup_pose_prediction(
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\core\predict.py", line 26, in setup_pose_prediction
net_heads = PoseNetFactory.create(cfg).test(inputs)
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\nnets\base.py", line 85, in test
heads = self.get_net(inputs)
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\nnets\resnet.py", line 79, in get_net
net, end_points = self.extract_features(inputs)
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\nnets\resnet.py", line 41, in extract_features
net, end_points = net_fun(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\nets\resnet_v1.py", line 270, in resnet_v1_50
return resnet_v1(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\nets\resnet_v1.py", line 212, in resnet_v1
net = resnet_utils.stack_blocks_dense(net, blocks, output_stride)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\nets\resnet_utils.py", line 219, in stack_blocks_dense
net = block.unit_fn(net, rate=1, **unit)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\nets\resnet_v1.py", line 125, in bottleneck
residual = layers.conv2d(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\layers\layers.py", line 1171, in convolution2d
return convolution(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\layers\layers.py", line 1098, in convolution
outputs = normalizer_fn(outputs, **normalizer_params)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\layers\layers.py", line 684, in batch_norm
outputs = layer.apply(inputs, training=is_training)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\legacy_tf_layers\base.py", line 244, in apply
return self(*args, **kwargs)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\legacy_tf_layers\base.py", line 622, in __call__
outputs = super().__call__(inputs, *args, **kwargs)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\engine\base_layer_v1.py", line 838, in __call__
outputs = call_fn(cast_inputs, *args, **kwargs)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\legacy_tf_layers\normalization.py", line 237, in call
return super().call(inputs, training=training)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\layers\normalization\batch_normalization.py", line 850, in call
outputs = self._fused_batch_norm(inputs, training=training)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\layers\normalization\batch_normalization.py", line 660, in _fused_batch_norm
output, mean, variance = control_flow_util.smart_cond(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\utils\control_flow_util.py", line 108, in smart_cond
return tf.__internal__.smart_cond.smart_cond(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\layers\normalization\batch_normalization.py", line 649, in _fused_batch_norm_inference
return tf.compat.v1.nn.fused_batch_norm(
Node: 'resnet_v1_50/block1/unit_1/bottleneck_v1/conv3/BatchNorm/FusedBatchNormV3'
2 root error(s) found.
(0) RESOURCE_EXHAUSTED: OOM when allocating tensor with shape[8,486,486,256] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[{{node resnet_v1_50/block1/unit_1/bottleneck_v1/conv3/BatchNorm/FusedBatchNormV3}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info. This isn't available when running in Eager mode.
[[Sigmoid/_549]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info. This isn't available when running in Eager mode.
(1) RESOURCE_EXHAUSTED: OOM when allocating tensor with shape[8,486,486,256] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[{{node resnet_v1_50/block1/unit_1/bottleneck_v1/conv3/BatchNorm/FusedBatchNormV3}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info. This isn't available when running in Eager mode.
0 successful operations.
0 derived errors ignored.
Original stack trace for 'resnet_v1_50/block1/unit_1/bottleneck_v1/conv3/BatchNorm/FusedBatchNormV3':
File "c:\code\deeplabcut\deeplabcut\gui\utils.py", line 22, in run
self.func()
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\predict_videos.py", line 606, in analyze_videos
sess, inputs, outputs = predict.setup_pose_prediction(
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\core\predict.py", line 26, in setup_pose_prediction
net_heads = PoseNetFactory.create(cfg).test(inputs)
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\nnets\base.py", line 85, in test
heads = self.get_net(inputs)
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\nnets\resnet.py", line 79, in get_net
net, end_points = self.extract_features(inputs)
File "c:\code\deeplabcut\deeplabcut\pose_estimation_tensorflow\nnets\resnet.py", line 41, in extract_features
net, end_points = net_fun(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\nets\resnet_v1.py", line 270, in resnet_v1_50
return resnet_v1(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\nets\resnet_v1.py", line 212, in resnet_v1
net = resnet_utils.stack_blocks_dense(net, blocks, output_stride)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\nets\resnet_utils.py", line 219, in stack_blocks_dense
net = block.unit_fn(net, rate=1, **unit)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\nets\resnet_v1.py", line 125, in bottleneck
residual = layers.conv2d(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\layers\layers.py", line 1171, in convolution2d
return convolution(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\layers\layers.py", line 1098, in convolution
outputs = normalizer_fn(outputs, **normalizer_params)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\ops\arg_scope.py", line 184, in func_with_args
return func(*args, **current_args)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tf_slim\layers\layers.py", line 684, in batch_norm
outputs = layer.apply(inputs, training=is_training)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\legacy_tf_layers\base.py", line 244, in apply
return self(*args, **kwargs)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\legacy_tf_layers\base.py", line 622, in __call__
outputs = super().__call__(inputs, *args, **kwargs)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\engine\base_layer_v1.py", line 838, in __call__
outputs = call_fn(cast_inputs, *args, **kwargs)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 689, in wrapper
return converted_call(f, args, kwargs, options=options)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 331, in converted_call
return _call_unconverted(f, args, kwargs, options, False)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 458, in _call_unconverted
return f(*args, **kwargs)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\legacy_tf_layers\normalization.py", line 237, in call return super().call(inputs, training=training)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\layers\normalization\batch_normalization.py", line 850, in call
outputs = self._fused_batch_norm(inputs, training=training)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\layers\normalization\batch_normalization.py", line 660, in _fused_batch_norm
output, mean, variance = control_flow_util.smart_cond(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\utils\control_flow_util.py", line 108, in smart_cond
return tf.__internal__.smart_cond.smart_cond(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\framework\smart_cond.py", line 54, in smart_cond
return false_fn()
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\keras\layers\normalization\batch_normalization.py", line 649, in _fused_batch_norm_inference
return tf.compat.v1.nn.fused_batch_norm(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\util\traceback_utils.py", line 150, in error_handler
return fn(*args, **kwargs)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\util\dispatch.py", line 1176, in op_dispatch_handler
return dispatch_target(*args, **kwargs)
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\ops\nn_impl.py", line 1691, in fused_batch_norm
y, running_mean, running_var, _, _, _ = gen_nn_ops.fused_batch_norm_v3(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 4504, in fused_batch_norm_v3
_, _, _op, _outputs = _op_def_library._apply_op_helper(
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 797, in _apply_op_helper
op = g._create_op_internal(op_type_name, inputs, dtypes=None,
File "C:\Users\hoben\miniconda3\envs\dlc\lib\site-packages\tensorflow\python\framework\ops.py", line 3800, in _create_op_internalAnything else?
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
howtousedlcissue regarding the use of DeepLabCut
Activity
n-poulsen commentedon Jul 20, 2023
Hi @horsto, it seems that you're running out of GPU memory when trying to analyze the videos.
Could you try setting a lower batch size in your project
config.yamlfile and see if that works (try 4, 2 or 1)?[-]Error when trying to analyze videos[/-][+]`RESOURCE_EXHAUSTED: OOM when allocating tensor with shape[8,486,486,256]` >> change batch size[/+]