Cannot import name 'model_lib_v2'

Hello! I am trying to train a model but I keep getting an error message.

Requirement already satisfied: pycocotools in /Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages (2.0.7)
Requirement already satisfied: matplotlib>=2.1.0 in /Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages (from pycocotools) (3.8.2)
Requirement already satisfied: numpy in /Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages (from pycocotools) (1.26.4)
Requirement already satisfied: contourpy>=1.0.1 in /Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages (from matplotlib>=2.1.0->pycocotools) (1.2.0)
Requirement already satisfied: cycler>=0.10 in /Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages (from matplotlib>=2.1.0->pycocotools) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages (from matplotlib>=2.1.0->pycocotools) (4.48.1)
Requirement already satisfied: kiwisolver>=1.3.1 in /Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages (from matplotlib>=2.1.0->pycocotools) (1.4.5)
Requirement already satisfied: packaging>=20.0 in /Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages (from matplotlib>=2.1.0->pycocotools) (23.2)
Requirement already satisfied: pillow>=8 in /Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages (from matplotlib>=2.1.0->pycocotools) (10.2.0)
Requirement already satisfied: pyparsing>=2.3.1 in /Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages (from matplotlib>=2.1.0->pycocotools) (3.1.1)
Requirement already satisfied: python-dateutil>=2.7 in /Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages (from matplotlib>=2.1.0->pycocotools) (2.8.2)
Requirement already satisfied: six>=1.5 in /Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib>=2.1.0->pycocotools) (1.16.0)
Traceback (most recent call last):
  File "/Users/zaharsoldatkin/Projects/MuteTalk/Tensorflow/models/research/object_detection/model_main_tf2.py", line 31, in <module>
    from object_detection import model_lib_v2
ImportError: cannot import name 'model_lib_v2' from 'object_detection' (/Users/zaharsoldatkin/anaconda3/envs/tensorflow/lib/python3.10/site-packages/object_detection/__init__.py)

What do I do? I really need help…

does that file exisit in the directory its looking for it in?

Hi @Zach_Soldatkin, Currently there is only support for tensorflow official model. The research models will contain deprecated lines of code causing the error i request you to use official models. Thank You.