AssertionError: `train_dir` is missing.
Please go to Stack Overflow for help and support:
http://stackoverflow.com/questions/tagged/tensorflow
Also, please understand that many of the models included in this repository are experimental and research-style code. If you open a GitHub issue, here is our policy:
- It must be a bug, a feature request, or a significant problem with documentation (for small docs fixes please send a PR instead).
- The form below must be filled out.
Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.
System information
-
I am implementing the procedure from this blog post. Which is similar - https://www.freecodecamp.org/news/how-to-play-quidditch-using-the-tensorflow-object-detection-api-b0742b99065d/
-
No I didn't
-
Windows 10
-
Tensorflow installed in pycharm
-
Tensorflow 1.8
-
Bazel version (if compiling from source):
-
NVIDIA 1050ti
-
Exact command to reproduce:
You can collect some of this information using our environment capture script:
https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh
You can obtain the TensorFlow version with
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
Describe the problem
When I am trying to run
python object_detection/train.py --logtostderr --pipeline_config_path=pipeline.config --train_dir=train
this command for object detection using Tensorflow I'm getting this error -
AssertionError: train_dir is missing.
I have tried to find for a solution but couldn't find one. Not sure where is the problem.
Source code / logs
Traceback (most recent call last):
File "object_detection/train.py", line 163, in train_dir is missing.'
AssertionError: train_dir is missing.
Check once, I think there is no 'train' directory in the directory containing train.py .
@QuickLearner171998 bro the code should create a Train folder by itself.
No I read the code again. See line 87. If the train_dir is missing then it will throw assertion error. Moreover there is no command in it to create a new dir.
Tensorflow Object Detection API requires Tensorflow (>=1.12.0) See https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md
How I solved is typing the whole training command by myself, not copy-paste.
I went inside the train.py file and saw the following:

Make sure that you type the command exactly like that. In my case, I was not passing in the "train_dir" argument. Hope this helps.
same error train_dir is missing
!python /content/drive/MyDrive/nvidia-tao/models/research/object_detection/dataset_tools/create_coco_tf_record.py \
--logtostderr \
--train_image_dir= /content/drive/MyDrive/kitti_data/training/test_trecord/train/ \
--val_image_dir= /content/drive/MyDrive/kitti_data/training/test_trecord/train/ \
--train_object_annotations_file= /content/drive/MyDrive/kitti_data/training/test_trecord/_annotations.coco.json \
--val_object_annotations_file= /content/drive/MyDrive/kitti_data/training/test_trecord/_annotations.coco.json \
--output_dir= /content/drive/MyDrive/kitti_data/training/test_trecord/test_tfrecord
why i am getting error when i run create_coco_tf_record.py file on colab