TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10: Train.py not found

I am getting the following error for - D:\tensorflow\models\research\object_detection>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config Error- python: can’t open file ‘train.py’: [Errno 2] No such file or directory

I checked there is no such file train.py even in tensorflows github page too

About this issue

Most upvoted comments

Your script should become: python legacy/train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config

They put it in the folder legacy. Now you can execute model_main.py which runs train and eval at the same time.

Apparently.

@mihuzz It appears to be that calibration.proto was not included in the protobuff command. As mentioned in the tutorial: “(Note: TensorFlow occassionally adds new .proto files to the \protos folder. If you get an error saying ImportError: cannot import name ‘something_something_pb2’ , you may need to update the protoc command to include the new .proto files.)”

Run the command again, but include “calibration.proto”.

protoc --python_out=. .\object_detection\protos\anchor_generator.proto .\object_detection\protos\argmax_matcher.proto .\object_detection\protos\bipartite_matcher.proto .\object_detection\protos\box_coder.proto .\object_detection\protos\box_predictor.proto .\object_detection\protos\eval.proto .\object_detection\protos\faster_rcnn.proto .\object_detection\protos\faster_rcnn_box_coder.proto .\object_detection\protos\grid_anchor_generator.proto .\object_detection\protos\hyperparams.proto .\object_detection\protos\image_resizer.proto .\object_detection\protos\input_reader.proto .\object_detection\protos\losses.proto .\object_detection\protos\matcher.proto .\object_detection\protos\mean_stddev_box_coder.proto .\object_detection\protos\model.proto .\object_detection\protos\optimizer.proto .\object_detection\protos\pipeline.proto .\object_detection\protos\post_processing.proto .\object_detection\protos\preprocessor.proto .\object_detection\protos\region_similarity_calculator.proto .\object_detection\protos\square_box_coder.proto .\object_detection\protos\ssd.proto .\object_detection\protos\ssd_anchor_generator.proto .\object_detection\protos\string_int_label_map.proto .\object_detection\protos\train.proto .\object_detection\protos\keypoint_box_coder.proto .\object_detection\protos\multiscale_anchor_generator.proto .\object_detection\protos\graph_rewriter.proto .\object_detection\protos\calibration.proto

I can’t run the Training, maybe someone can help me (tensorflow1) C:\tensorflow1\models\research\object_detection>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config 2020-08-10 22:08:00.754622: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll Traceback (most recent call last): File “train.py”, line 53, in <module> from object_detection.builders import model_builder File “C:\Users\ASUS\anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\builders\model_builder.py”, line 39, in <module> from object_detection.protos import model_pb2 File “C:\Users\ASUS\anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\protos\model_pb2.py”, line 14, in <module> from object_detection.protos import center_net_pb2 as object__detection_dot_protos_dot_center__net__pb2 ImportError: cannot import name ‘center_net_pb2’ from ‘object_detection.protos’ (C:\Users\ASUS\anaconda3\envs\tensorflow1\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\protos_init_.py)

hello ektavyas i saw above that you had an error similar to mine, and apparently it was a typo. Can you tell me how you went about solving it

File “train.py”, line 180, in main graph_hook_fn=graph_rewriter_fn)

I have the same issue