Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
System information
- What is the top-level directory of the model you are using: models/research
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
- TensorFlow installed from (source or binary): binary (using pip)
- TensorFlow version (use command below): 1.14
- Bazel version (if compiling from source):
- CUDA/cuDNN version: 10.1 / 7.4.2
- GPU model and memory: 2 RTX 2080 Super
- Exact command to reproduce:
Describe the problem
I am running object detection API on custom dataset, tensorflow object detection API is installed correctly, test is passed. Dataset is converted to tfrecord format and pipeline configuration is ok.
There is a problem in starting cuDNN handle, which results in failed to get convolution algorithms.
Through my search, there may be several reasons:
-
session_config.gpu_options.allow_growth = Truemust be set in RTX card. If this is the case, what is the proper way to fix this. In which file (I guess trainer.py) this fix should be placed? -
2 GPUs may cause problems
Source code / logs
/home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) WARNING:tensorflow: 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.
WARNING:tensorflow:From /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/slim-0.1-py3.6.egg/nets/inception_resnet_v2.py:374: The name tf.GraphKeys is deprecated. Please use tf.compat.v1.GraphKeys instead.
WARNING:tensorflow:From /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/slim-0.1-py3.6.egg/nets/mobilenet/mobilenet.py:397: The name tf.nn.avg_pool is deprecated. Please use tf.nn.avg_pool2d instead.
WARNING:tensorflow:From object_detection/model_main.py:109: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/utils/config_util.py:102: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.
W1224 10:32:11.309172 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/utils/config_util.py:102: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/model_lib.py:628: The name tf.logging.warning is deprecated. Please use tf.compat.v1.logging.warning instead.
W1224 10:32:11.311061 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/model_lib.py:628: The name tf.logging.warning is deprecated. Please use tf.compat.v1.logging.warning instead.
WARNING:tensorflow:Forced number of epochs for all eval validations to be 1. W1224 10:32:11.311156 140370471044928 model_lib.py:629] Forced number of epochs for all eval validations to be 1. WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/utils/config_util.py:488: The name tf.logging.info is deprecated. Please use tf.compat.v1.logging.info instead.
W1224 10:32:11.311218 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/utils/config_util.py:488: The name tf.logging.info is deprecated. Please use tf.compat.v1.logging.info instead.
INFO:tensorflow:Maybe overwriting train_steps: 50000
I1224 10:32:11.311259 140370471044928 config_util.py:488] Maybe overwriting train_steps: 50000
INFO:tensorflow:Maybe overwriting use_bfloat16: False
I1224 10:32:11.311299 140370471044928 config_util.py:488] Maybe overwriting use_bfloat16: False
INFO:tensorflow:Maybe overwriting sample_1_of_n_eval_examples: 1
I1224 10:32:11.311335 140370471044928 config_util.py:488] Maybe overwriting sample_1_of_n_eval_examples: 1
INFO:tensorflow:Maybe overwriting eval_num_epochs: 1
I1224 10:32:11.311372 140370471044928 config_util.py:488] Maybe overwriting eval_num_epochs: 1
INFO:tensorflow:Maybe overwriting load_pretrained: True
I1224 10:32:11.311407 140370471044928 config_util.py:488] Maybe overwriting load_pretrained: True
INFO:tensorflow:Ignoring config override key: load_pretrained
I1224 10:32:11.311442 140370471044928 config_util.py:498] Ignoring config override key: load_pretrained
WARNING:tensorflow:Expected number of evaluation epochs is 1, but instead encountered eval_on_train_input_config.num_epochs = 0. Overwriting num_epochs to 1.
W1224 10:32:11.311750 140370471044928 model_lib.py:645] Expected number of evaluation epochs is 1, but instead encountered eval_on_train_input_config.num_epochs = 0. Overwriting num_epochs to 1.
INFO:tensorflow:create_estimator_and_inputs: use_tpu False, export_to_tpu False
I1224 10:32:11.311802 140370471044928 model_lib.py:680] create_estimator_and_inputs: use_tpu False, export_to_tpu False
INFO:tensorflow:Using config: {'_model_dir': 'ead/models/model_inception_resnet_v2_atrous', '_tf_random_seed': None, '_save_summary_steps': 100, '_save_checkpoints_steps': None, '_save_checkpoints_secs': 600, '_session_config': allow_soft_placement: true
graph_options {
rewrite_options {
meta_optimizer_iterations: ONE
}
}
, '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_log_step_count_steps': 100, '_train_distribute': None, '_device_fn': None, '_protocol': None, '_eval_distribute': None, '_experimental_distribute': None, '_experimental_max_worker_delay_secs': None, '_service': None, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7faa180b0048>, '_task_type': 'worker', '_task_id': 0, '_global_id_in_cluster': 0, '_master': '', '_evaluation_master': '', '_is_chief': True, '_num_ps_replicas': 0, '_num_worker_replicas': 1}
I1224 10:32:11.312070 140370471044928 estimator.py:209] Using config: {'_model_dir': 'ead/models/model_inception_resnet_v2_atrous', '_tf_random_seed': None, '_save_summary_steps': 100, '_save_checkpoints_steps': None, '_save_checkpoints_secs': 600, '_session_config': allow_soft_placement: true
graph_options {
rewrite_options {
meta_optimizer_iterations: ONE
}
}
, '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_log_step_count_steps': 100, '_train_distribute': None, '_device_fn': None, '_protocol': None, '_eval_distribute': None, '_experimental_distribute': None, '_experimental_max_worker_delay_secs': None, '_service': None, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7faa180b0048>, '_task_type': 'worker', '_task_id': 0, '_global_id_in_cluster': 0, '_master': '', '_evaluation_master': '', '_is_chief': True, '_num_ps_replicas': 0, '_num_worker_replicas': 1}
WARNING:tensorflow:Estimator's model_fn (<function create_model_fn.
W1224 10:32:11.342888 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/data_decoders/tf_example_decoder.py:182: The name tf.FixedLenFeature is deprecated. Please use tf.io.FixedLenFeature instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/data_decoders/tf_example_decoder.py:197: The name tf.VarLenFeature is deprecated. Please use tf.io.VarLenFeature instead.
W1224 10:32:11.343116 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/data_decoders/tf_example_decoder.py:197: The name tf.VarLenFeature is deprecated. Please use tf.io.VarLenFeature instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/builders/dataset_builder.py:64: The name tf.gfile.Glob is deprecated. Please use tf.io.gfile.glob instead.
W1224 10:32:11.356371 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/builders/dataset_builder.py:64: The name tf.gfile.Glob is deprecated. Please use tf.io.gfile.glob instead.
WARNING:tensorflow:num_readers has been reduced to 1 to match input file shards.
W1224 10:32:11.357255 140370471044928 dataset_builder.py:72] num_readers has been reduced to 1 to match input file shards.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/builders/dataset_builder.py:86: parallel_interleave (from tensorflow.contrib.data.python.ops.interleave_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.data.experimental.parallel_interleave(...).
W1224 10:32:11.362099 140370471044928 deprecation.py:323] From /home/ws2080/Desktop/codes/models/research/object_detection/builders/dataset_builder.py:86: parallel_interleave (from tensorflow.contrib.data.python.ops.interleave_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.data.experimental.parallel_interleave(...).
WARNING:tensorflow:From /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorflow/contrib/data/python/ops/interleave_ops.py:77: parallel_interleave (from tensorflow.python.data.experimental.ops.interleave_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.data.Dataset.interleave(map_func, cycle_length, block_length, num_parallel_calls=tf.data.experimental.AUTOTUNE) instead. If sloppy execution is desired, use tf.data.Options.experimental_determinstic.
W1224 10:32:11.362233 140370471044928 deprecation.py:323] From /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorflow/contrib/data/python/ops/interleave_ops.py:77: parallel_interleave (from tensorflow.python.data.experimental.ops.interleave_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.data.Dataset.interleave(map_func, cycle_length, block_length, num_parallel_calls=tf.data.experimental.AUTOTUNE) instead. If sloppy execution is desired, use tf.data.Options.experimental_determinstic.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/builders/dataset_builder.py:155: DatasetV1.map_with_legacy_function (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.data.Dataset.map()
W1224 10:32:11.377858 140370471044928 deprecation.py:323] From /home/ws2080/Desktop/codes/models/research/object_detection/builders/dataset_builder.py:155: DatasetV1.map_with_legacy_function (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.data.Dataset.map()
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/utils/ops.py:491: The name tf.is_nan is deprecated. Please use tf.math.is_nan instead.
W1224 10:32:11.489631 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/utils/ops.py:491: The name tf.is_nan is deprecated. Please use tf.math.is_nan instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/utils/ops.py:493: add_dispatch_support.
W1224 10:32:11.520374 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/core/preprocessor.py:627: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/core/preprocessor.py:2689: The name tf.image.resize_images is deprecated. Please use tf.image.resize instead.
W1224 10:32:11.550292 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/core/preprocessor.py:2689: The name tf.image.resize_images is deprecated. Please use tf.image.resize instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/inputs.py:168: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
W1224 10:32:11.640248 140370471044928 deprecation.py:323] From /home/ws2080/Desktop/codes/models/research/object_detection/inputs.py:168: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/builders/dataset_builder.py:158: batch_and_drop_remainder (from tensorflow.contrib.data.python.ops.batching) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.data.Dataset.batch(..., drop_remainder=True).
W1224 10:32:11.874983 140370471044928 deprecation.py:323] From /home/ws2080/Desktop/codes/models/research/object_detection/builders/dataset_builder.py:158: batch_and_drop_remainder (from tensorflow.contrib.data.python.ops.batching) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.data.Dataset.batch(..., drop_remainder=True).
INFO:tensorflow:Calling model_fn.
I1224 10:32:11.884140 140370471044928 estimator.py:1145] Calling model_fn.
INFO:tensorflow:Scale of 0 disables regularizer.
I1224 10:32:11.898115 140370471044928 regularizers.py:98] Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
I1224 10:32:11.898225 140370471044928 regularizers.py:98] Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
I1224 10:32:18.416866 140370471044928 regularizers.py:98] Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
I1224 10:32:18.454785 140370471044928 regularizers.py:98] Scale of 0 disables regularizer.
INFO:tensorflow:depth of additional conv before box predictor: 0
I1224 10:32:18.455076 140370471044928 convolutional_box_predictor.py:151] depth of additional conv before box predictor: 0
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/utils/spatial_transform_ops.py:419: calling crop_and_resize_v1 (from tensorflow.python.ops.image_ops_impl) with box_ind is deprecated and will be removed in a future version.
Instructions for updating:
box_ind is deprecated, use box_indices instead
W1224 10:32:19.056011 140370471044928 deprecation.py:506] From /home/ws2080/Desktop/codes/models/research/object_detection/utils/spatial_transform_ops.py:419: calling crop_and_resize_v1 (from tensorflow.python.ops.image_ops_impl) with box_ind is deprecated and will be removed in a future version.
Instructions for updating:
box_ind is deprecated, use box_indices instead
INFO:tensorflow:Scale of 0 disables regularizer.
I1224 10:32:19.066863 140370471044928 regularizers.py:98] Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
I1224 10:32:19.066964 140370471044928 regularizers.py:98] Scale of 0 disables regularizer.
WARNING:tensorflow:From /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorflow/contrib/layers/python/layers/layers.py:1634: flatten (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.flatten instead.
W1224 10:32:20.122197 140370471044928 deprecation.py:323] From /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorflow/contrib/layers/python/layers/layers.py:1634: flatten (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.flatten instead.
INFO:tensorflow:Scale of 0 disables regularizer.
I1224 10:32:20.234309 140370471044928 regularizers.py:98] Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
I1224 10:32:20.382894 140370471044928 regularizers.py:98] Scale of 0 disables regularizer.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/core/losses.py:177: The name tf.losses.huber_loss is deprecated. Please use tf.compat.v1.losses.huber_loss instead.
W1224 10:32:20.556293 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/core/losses.py:177: The name tf.losses.huber_loss is deprecated. Please use tf.compat.v1.losses.huber_loss instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/core/losses.py:183: The name tf.losses.Reduction is deprecated. Please use tf.compat.v1.losses.Reduction instead.
W1224 10:32:20.557175 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/core/losses.py:183: The name tf.losses.Reduction is deprecated. Please use tf.compat.v1.losses.Reduction instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/core/losses.py:350: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version. Instructions for updating:
Future major versions of TensorFlow will allow gradients to flow into the labels input on backprop by default.
See tf.nn.softmax_cross_entropy_with_logits_v2.
W1224 10:32:20.588500 140370471044928 deprecation.py:323] From /home/ws2080/Desktop/codes/models/research/object_detection/core/losses.py:350: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version. Instructions for updating:
Future major versions of TensorFlow will allow gradients to flow into the labels input on backprop by default.
See tf.nn.softmax_cross_entropy_with_logits_v2.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/model_lib.py:380: The name tf.train.get_or_create_global_step is deprecated. Please use tf.compat.v1.train.get_or_create_global_step instead.
W1224 10:32:20.751060 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/model_lib.py:380: The name tf.train.get_or_create_global_step is deprecated. Please use tf.compat.v1.train.get_or_create_global_step instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/builders/optimizer_builder.py:58: The name tf.train.MomentumOptimizer is deprecated. Please use tf.compat.v1.train.MomentumOptimizer instead.
W1224 10:32:20.756265 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/builders/optimizer_builder.py:58: The name tf.train.MomentumOptimizer is deprecated. Please use tf.compat.v1.train.MomentumOptimizer instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/model_lib.py:408: The name tf.summary.scalar is deprecated. Please use tf.compat.v1.summary.scalar instead.
W1224 10:32:20.756437 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/model_lib.py:408: The name tf.summary.scalar is deprecated. Please use tf.compat.v1.summary.scalar instead.
/home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorflow/python/ops/gradients_util.py:93: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. " /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/tensorflow/python/ops/gradients_util.py:93: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. " WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/model_lib.py:515: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.
W1224 10:32:26.421885 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/model_lib.py:515: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.
WARNING:tensorflow:From /home/ws2080/Desktop/codes/models/research/object_detection/model_lib.py:520: The name tf.train.Scaffold is deprecated. Please use tf.compat.v1.train.Scaffold instead.
W1224 10:32:27.109842 140370471044928 deprecation_wrapper.py:119] From /home/ws2080/Desktop/codes/models/research/object_detection/model_lib.py:520: The name tf.train.Scaffold is deprecated. Please use tf.compat.v1.train.Scaffold instead.
INFO:tensorflow:Done calling model_fn.
I1224 10:32:27.110154 140370471044928 estimator.py:1147] Done calling model_fn.
INFO:tensorflow:Create CheckpointSaverHook.
I1224 10:32:27.111032 140370471044928 basic_session_run_hooks.py:541] Create CheckpointSaverHook.
INFO:tensorflow:Graph was finalized.
I1224 10:32:30.541843 140370471044928 monitored_session.py:240] Graph was finalized.
2019-12-24 10:32:30.542088: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
2019-12-24 10:32:30.546518: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcuda.so.1
2019-12-24 10:32:30.891659: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x59eb5d0 executing computations on platform CUDA. Devices:
2019-12-24 10:32:30.891713: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): GeForce RTX 2080, Compute Capability 7.5
2019-12-24 10:32:30.891736: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (1): GeForce RTX 2080, Compute Capability 7.5
2019-12-24 10:32:30.913691: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3700000000 Hz
2019-12-24 10:32:30.914949: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x97c0e80 executing computations on platform Host. Devices:
2019-12-24 10:32:30.914990: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0):
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "object_detection/model_main.py", line 109, in
Errors may have originated from an input operation. Input Source operations connected to node FirstStageFeatureExtractor/InceptionResnetV2/InceptionResnetV2/Conv2d_1a_3x3/Conv2D: IteratorGetNext (defined at object_detection/model_main.py:105) FirstStageFeatureExtractor/InceptionResnetV2/Conv2d_1a_3x3/weights/read (defined at /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/slim-0.1-py3.6.egg/nets/inception_resnet_v2.py:163)
Input Source operations connected to node FirstStageFeatureExtractor/InceptionResnetV2/InceptionResnetV2/Conv2d_1a_3x3/Conv2D: IteratorGetNext (defined at object_detection/model_main.py:105) FirstStageFeatureExtractor/InceptionResnetV2/Conv2d_1a_3x3/weights/read (defined at /home/ws2080/environments/tensorflow_1_15/lib/python3.6/site-packages/slim-0.1-py3.6.egg/nets/inception_resnet_v2.py:163)
Original stack trace for 'FirstStageFeatureExtractor/InceptionResnetV2/InceptionResnetV2/Conv2d_1a_3x3/Conv2D':
File "object_detection/model_main.py", line 109, in
I have solved the training issue by doing the followings:
-
After
session_config = tf.ConfigProto(allow_soft_placement=True, log_device_placement=False)I added
session_config.gpu_options.allow_growth = True -
Instead of running object_detection/model_main.py file as stated in the documentation, I directly run the object_detection/legacy/train.py file.
After these modifications training is run successfully. Now, I want to evaluate evaluation dataset by directly running legacy/eval.py file. Yet, I again get the CUDNN_STATUS_INTERNAL_ERROR
I think legacy/evaluator.py file should be changed as I did in the above but I cannot find where the session object configuration is set.
I guess session GPU configurations in the training is not written to the saved model/graph object because when allow_growth=True is set, training works (I think it is due to the RTX cards). Yet, when the saved model is called in evaluation, it gives error as if allow_growth=True option is not set. Is there a way to save this option to saved model?
I have solved the training issue by doing the followings:
- After
session_config = tf.ConfigProto(allow_soft_placement=True, log_device_placement=False)I addedsession_config.gpu_options.allow_growth = True- Instead of running object_detection/model_main.py file as stated in the documentation, I directly run the object_detection/legacy/train.py file.
After these modifications training is run successfully. Now, I want to evaluate evaluation dataset by directly running legacy/eval.py file. Yet, I again get the CUDNN_STATUS_INTERNAL_ERROR
I think legacy/evaluator.py file should be changed as I did in the above but I cannot find where the session object configuration is set.
@GorkemP In which file was this line present?
It is exist in research/object_detection/legacy/trainer.py
It is exist in research/object_detection/legacy/trainer.py
Yes, i got that. Thank you. But i am still encountering the same issue. I tried running object_detection/legacy/train.py file, it os showing below error
OP_REQUIRES failed at cwise_ops_common.cc:70 : Resource exhausted: OOM when allocating tensor with shape[3,3,64,128] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
May i know what was your image dimension?
Can you please tell me what else solved your issue ? Would be very helpful.
I am using RTX 2070 Super, TF: 1.14.0
Image dimension is 512x512. Maybe you can try to decrease batch size, it seems that there is a memory issue.
Image dimension is 512x512. Maybe you can try to decrease batch size, it seems that there is a memory issue.
Mine is 4k images, 4032x3024 dimension. I guess, I should reduce this.
Image dimension is 512x512. Maybe you can try to decrease batch size, it seems that there is a memory issue.
Did you run eval.py ? I am getting the same error for that.
@Praveenk8051 Same problem! Have you find the solution? :)
@charming16 Happy to help you.
So there are 2 ways you can train the model, One by using research/object_detection/legacy/trainer.py and
another by model_main.py
I first executed model_main.py and got the captioned error. Then I executed trainer.py with the presence of GPU it worked like a charm.
Then I executed the eval.py on a machine which had no GPU and it worked. So basically i used system with GPU to train and system with no GPU to evaluate
What fixed the problem for me was adding these few lines of code directly into the model_main.py, I replaced this line
config = tf.estimator.RunConfig(model_dir=FLAGS.model_dir)
with
session_config = tf.ConfigProto(allow_soft_placement=True, log_device_placement=False)
session_config.gpu_options.allow_growth = True
session_config.gpu_options.per_process_gpu_memory_fraction = .8
config=tf.estimator.RunConfig(model_dir=FLAGS.model_dir, session_config=session_config)
and everything works just fine without using the legacy scripts, both training and evaluation.
My GPU is RTX 2070 Super.
Note:
The line
session_config.gpu_options.per_process_gpu_memory_fraction = .8
was in my case necessary for evaluation to run without an OUT_OF_MEMORY error.
@charming16 Happy to help you. So there are 2 ways you can train the model, One by using
research/object_detection/legacy/trainer.pyand another bymodel_main.pyI first executed
model_main.pyand got the captioned error. Then I executedtrainer.pywith the presence of GPU it worked like a charm.Then I executed the
eval.pyon a machine which had no GPU and it worked. So basically i used system with GPU to train and system with no GPU to evaluate
I truly appreciate your timely help! I've trained my ssd-mobilenet model and it works perfectly after using legacy/train.py. @Praveenk8051
What fixed the problem for me was adding these few lines of code directly into the
model_main.py, I replaced this lineconfig = tf.estimator.RunConfig(model_dir=FLAGS.model_dir)withsession_config = tf.ConfigProto(allow_soft_placement=True, log_device_placement=False) session_config.gpu_options.allow_growth = True session_config.gpu_options.per_process_gpu_memory_fraction = .8 config=tf.estimator.RunConfig(model_dir=FLAGS.model_dir, session_config=session_config)and everything works just fine without using the legacy scripts, both training and evaluation. My GPU is RTX 2070 Super.Note: The line
session_config.gpu_options.per_process_gpu_memory_fraction = .8was in my case necessary for evaluation to run without an OUT_OF_MEMORY error.
Thank you so much @Pavless. OUT_OF_MEMORY error also troubles me a lot. I'll have a try later:)
Closing this as the issue seems to be resolved! Feel free to reopen if anything else comes up.