module 'tensorflow' has no attribute 'contrib'

在新电脑上安装了tensorflow后(参考这篇),像以前一样,想验证一下object_detection接口能不能调用,结果各种问题,无奈又把anaconda和tensorflow安装了一遍,现在我的环境是这样的:

python版本:

module 'tensorflow' has no attribute 'contrib'

tensorflow版本:

module 'tensorflow' has no attribute 'contrib'

jupyter notebook版本:

module 'tensorflow' has no attribute 'contrib'

但执行测试程序model_builder_test.py还是报错:

module 'tensorflow' has no attribute 'contrib'

在网上查了一下,发现tensorflow 2.0版本确实有这个问题。只好把旧电脑上的tensorflow环境拷过来,才成功调用了object_detection接口,这个tensorflow的版本情况是:

python 3.5.6

tensorflow 1.10.0