#Trouble with starting training job, tf2 object detection

6 messages · Page 1 of 1 (latest)

woven brook
#

Hello, I am having a bit of trouble with a project I am working on:

I have been following the following tutorial to train my own object detection model:
https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html#training-the-model

Everything has been working well so far, until its time to actually run the training job. The tutorial says to run the following command in a certain directory:

python model_main_tf2.py --model_dir=models/my_ssd_resnet50_v1_fpn --pipeline_config_path=models/my_ssd_resnet50_v1_fpn/pipeline.config

I run the command in the correct directory, but in windows 10 command prompt I get errors like AttributeError: module 'tensorflow' has no attribute 'contrib' because the script is trying to run other scripts that contain tensorflow 1 modules but I have tensorflow 2 installed, also the tutorial is written for tensorflow 2 so im not sure why this is happening.

I also tried running the script in the same directory through an anaconda prompt, but there I get a different error:

AttributeError: partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' (most likely due to a circular import)

Ive been trying to solve for quite a while now, so any help at all would be greatly appreciated.

tough narwhal
#

I run into the module issues a lot with material that has become dated. Even recently published courses call into compatibility namespaces that have been replaced. I ususally just google it and find the new replacement very little has been removed without being replaced.

woven brook
#

so how would you recommend I proceed? Do you mean I should go replace the tf1 modules with the updated tf2 versions?

tough narwhal
#

Yeah like I have yet to run into anything that didn’t just change names

woven brook
#

Alright, thanks for your help, if you happen to know off hand is there a place that lists the “conversions” for each of the depreciated modules?

tough narwhal
#

No, but I have always found it with a quick google of the import path