AttributeError: module 'tensorflow' has no attribute 'contrib'

I am trying to run this command:
python Tensorflow/models/research/object_detection/model_main_tf2.py --model_dir=Tensorflow/workspace/models/my_ssd_mobnet --pipeline_config_path=Tensorflow/workspace/models/my_ssd_mobnet/pipeline.config --num_train_steps=2000

and I get this error: AttributeError: module ‘tensorflow’ has no attribute ‘contrib’

I know this is because I am using a newer version of tensorflow but I can’t downgrade my python version due to the hardware I am using. Is it possible to get the right tensorflow version for this (I think 2.4 should work) or is there some other way I can solve this error? Thanks!

Solved: import tensorflow worked for me