question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot import name 'center_net_pb2'

See original GitHub issue

I followed the tutorial exactly and did everything exactly as it was written. I started all over again and twice the same mistake:

`(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-06-23 11:00:32.995237: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘cudart64_100.dll’; dlerror: cudart64_100.dll not found 2020-06-23 11:00:33.002556: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. Traceback (most recent call last): File “train.py”, line 53, in <module> from object_detection.builders import model_builder File “C:\tensorflow1\models\research\object_detection\builders\model_builder.py”, line 38, in <module> from object_detection.protos import model_pb2 File “C:\tensorflow1\models\research\object_detection\protos\model_pb2.py”, line 15, 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’

(tensorflow1) C:\tensorflow1\models\research\object_detection>`

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12

github_iconTop GitHub Comments

3reactions
MrByte98commented, Nov 16, 2020

i have the same problem. anyone can fix it.

2reactions
Tylersuardcommented, Jun 24, 2020

Ok go to the models/research directory.

Enter the following:

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 ./object_detection/protos/flexible_grid_anchor_generator.proto ./object_detection/protos/center_net.proto The only result you should get back is a warning, saying: object_detection/protos/input_reader.proto: warning: Import object_detection/protos/image_resizer.proto but not used.

Then, in that same directory, run: python setup.py build

and then

python setup.py install

Re-run all commands after this point, including xml to csv and generate_tfrecord.py

Let me know if that helps

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: cannot import name "center_net_pb2" · Issue #8721
When I run that command, it searches the protos folder for center_net_pb2.py, which does not exist. It asks for 2 other _pb2.py files,...
Read more >
Cannot import name '_centered' from 'scipy.signal.signaltools'
Basically it just re-publishes the existing (but private) _centered function as a public attribute to the module already imported in RAM.
Read more >
How to Fix ImportError: Cannot Import Name in Python - Rollbar
The Python ImportError: cannot import name error occurs when an imported class is not accessible or is in a circular dependency.
Read more >
How to Fix : “ImportError: Cannot import name X” in Python?
You can solve the “ImportError: Cannot import name X” Error by resolving the circular dependencies. You can do that either by eliminating ...
Read more >
How do I fix the ImportError: cannot import name 'delayed'?
I am using the LORAS package from pyloras for imbalanced learning, but it requires importing the delayed package. I used the pip.main() to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found