Categories
Misc

ImportError: cannot import name ‘model_lib_v2’ from ‘object_detection’ (C:UsersASUSAppDataRoamingPythonPython38site-packagesobject_detection__init__.py)

ImportError: cannot import name 'model_lib_v2' from 'object_detection' (C:UsersASUSAppDataRoamingPythonPython38site-packagesobject_detection__init__.py)

Object detection api import error

This was what i managed to do succesfully. Basicallly followed instructions from here Gilbert Tanner github.

git clone https://github.com/tensorflow/models.git

cd models/research

# Compile protos.

protoc object_detection/protos/*.proto –python_out=.

# Install TensorFlow Object Detection API.

i manually copied setup.py from packages/tf2 folder to object_detection/packages/tf2/setup.py

python -m pip install .

All these ran smoothly without warning messages.

I tested it with

python -c “import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000,1000])))”
and it works fine i got the printed output without any error.

python generate_tfrecord.py –csv_input=images/train_labels.csv –image_dir=images/train –output_path=train.record
works as well i got the train.record file.

However, when i tried to Training the model with

python model_main_tf2.py –pipeline_config_path=training/ssd_efficientdet_d0_512x512_coco17_tpu-8.config –model_dir=training –alsologtostderr

this came up.

https://preview.redd.it/aqkt00tzmki61.png?width=1167&format=png&auto=webp&s=3b2e296fc9b7282d9d604459a178a1e6fd7826b9

submitted by /u/slpypnda
[visit reddit] [comments]

Leave a Reply

Your email address will not be published. Required fields are marked *