环境:windows10+python3.6+tensorflow1.14
报错: File "E:\Anaconda3\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\utils\ops.py", line 291, in <module>
dtype=tf.float32):
AttributeError: module 'tensorflow' has no attribute 'float32'
测试环境时总是报module 'tensorflow' has no attribute 'float32',但是tensorflow1.14的确有float32,为了这个问题折腾了两天,重新配置了无数次,最后发现原因是我在执行完protoc命令后,直接在Powershell里运行了test程序,而默认的是tensorflow2.0,没有切换到tensorflow1.14所在的虚拟环境。
注意:若在jupyter下运行测试程序,一定要看是不是在相应的虚拟环境下!!