0
votes

I was trying to use the faster_rcnn_inception_v2_coco_2018_01_28 for my first object detection project. I was trying to train the model, and got this error. Before this error occurred, I was struggling with 'abs' being not found. I reinstalled tensorflow, and somehow it worked.

This is the code that I ran on cmd. If I need to post what's in train.py or any code that I should have posted here, let me know.

(tf1.12) C:\Users\EuisanKim\Desktop\tf1.12\model\research\object_detection>python legacy/train.py --logtostderr --train_dir=training/ --pipeline_config=training/faster_rcnn_inception_v2_pets.config

C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\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)]) C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\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)]) C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\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)]) C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\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)]) C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\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)]) C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\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)]) C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\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)]) C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\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)]) C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\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)]) C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\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)]) C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\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)]) C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\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: Logging before flag parsing goes to stderr. W0829 08:28:04.658330 10092 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.

W0829 08:28:04.851034 10092 deprecation_wrapper.py:119] From C:\Users\EuisanKim\Desktop\tf1.12\model\research\slim\nets\inception_resnet_v2.py:373: The name tf.GraphKeys is deprecated. Please use tf.compat.v1.GraphKeys instead.

W0829 08:28:04.878998 10092 deprecation_wrapper.py:119] From C:\Users\EuisanKim\Desktop\tf1.12\model\research\slim\nets\mobilenet\mobilenet.py:397: The name tf.nn.avg_pool is deprecated. Please use tf.nn.avg_pool2d instead.

W0829 08:28:04.907918 10092 deprecation_wrapper.py:119] From legacy/train.py:55: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.

W0829 08:28:04.908879 10092 deprecation_wrapper.py:119] From legacy/train.py:55: The name tf.logging.INFO is deprecated. Please use tf.compat.v1.logging.INFO instead.

W0829 08:28:04.913866 10092 deprecation_wrapper.py:119] From legacy/train.py:184: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.

W0829 08:28:04.916857 10092 deprecation.py:323] From C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\site-packages\absl\app.py:251: main (from main) is deprecated and will be removed in a future version. Instructions for updating: Use object_detection/model_main.py. W0829 08:28:04.917856 10092 deprecation_wrapper.py:119] From legacy/train.py:90: The name tf.gfile.MakeDirs is deprecated. Please use tf.io.gfile.makedirs instead.

W0829 08:28:04.920847 10092 deprecation_wrapper.py:119] From legacy/train.py:107: The name tf.gfile.Copy is deprecated. Please use tf.io.gfile.copy instead.

Fatal Python error: Segmentation fault

Current thread 0x0000276c (most recent call first): File "C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 486 in copy_v2 File "C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 469 in copy File "legacy/train.py", line 108 in main File "C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\site-packages\tensorflow\python\util\deprecation.py", line 324 in new_func File "C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\site-packages\absl\app.py", line 251 in _run_main File "C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\site-packages\absl\app.py", line 300 in run File "C:\Users\EuisanKim\Anaconda3\envs\tf1.12\lib\site-packages\tensorflow\python\platform\app.py", line 40 in run File "legacy/train.py", line 184 in

What I did before running the code above are:

1) Annotating the data - I was using different sizes of pictures (Could this lead to this error?)

2) Creating the record files, label map file, and etc that are necessary for training

I just started to learn programming. I don't know much about what's happening with this problem. Please, help me. Thank you.

1
You should the code that is throwing that error. You should also try to explain what you are trying to do with more context. Check the "Help Center" for more information about how to write a good question.guzmonne
Thank you for the comment. All I did was preparing data and changing the path for the configuration. I will try to edit the question.PositivelyPossible

1 Answers

1
votes

It is due to .

  1. An import issue is there
  2. Code being written in python2 but running in python3

Do these steps to remove this error,

  1. Put from object_detection import eval_util as last import in file model_lib.py under research/object_detection
  2. Wrap range() objects with list() in API code (to support python3)