no attribute 'outside_compilation'錯誤

記下當前跑
python export_inference_graph.py --input_type image_tensor --pipeline_config_path data/ssdlite_mobilenet_v1_coco.config --trained_checkpoint_prefix training/model.ckpt-20000 --output_directory inference_graphpython

準備將已訓練到ckpt階段的文件轉成pb文件。結果報
Traceback (most recent call last):
File "export_inference_graph.py", line 150, in <module>
tf.app.run()
File "D:\PycharmProjects\OpenCV_Tensor_Env\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "export_inference_graph.py", line 146, in main
write_inference_graph=FLAGS.write_inference_graph)
File "D:\PycharmProjects\models-master\research\object_detection\exporter.py", line 497, in export_inference_graph
write_inference_graph=write_inference_graph)
File "D:\PycharmProjects\models-master\research\object_detection\exporter.py", line 400, in _export_inference_graph
graph_hook_fn=graph_hook_fn)
File "D:\PycharmProjects\models-master\research\object_detection\exporter.py", line 367, in build_detection_graph
output_collection_name=output_collection_name)
File "D:\PycharmProjects\models-master\research\object_detection\exporter.py", line 346, in _get_outputs_from_inputs
output_tensors, true_image_shapes)
File "D:\PycharmProjects\models-master\research\object_detection\meta_architectures\ssd_meta_arch.py", line 802, in postprocess
prediction_dict.get('mask_predictions')
File "D:\PycharmProjects\models-master\research\object_detection\meta_architectures\ssd_meta_arch.py", line 785, in _non_max_suppression_wrapper
return tf.contrib.tpu.outside_compilation(
AttributeError: module 'tensorflow.contrib.tpu' has no attribute 'outside_compilation'網絡

如今還未解。不過看錯誤信息,分析以下
meta_architectures\ssd_meta_arch.py 看樣子可能和架構相關(有architectures)
tensorflow.contrib.tpu 看tpu多是和google的TPU架構相關。
本人的機器是普通PC就是GPU訓練而已,那爲何會引導到用TPU 轉換呢?
當前訓練配置用的是ssdlite_mobilenet_v1_coco.config,原本覺得會更lite些。
回頭仍是老老實實跑下ssd_mobilenet_v1_coco.config看看吧,有結果會更新。架構

結論:你們訓練時能夠用些網上其餘夥伴跑經過的模型先學習,回頭熟練了再更進一步嘗試其它網絡。
筆者換了model的版本,改model-1.13.0不報no attribute 'outside_compilation'(model-master做爲主開發分支,已經加入Tensorflow2.x支持。可能代碼上還不夠穩定吧。)app

MARK下
Software Env: win10 64位+procobuf新版+COCOAPI新版+VS2017+model 1.13.0+Tensorflow-gpu 1.11.0+CUDA9+cudnn7
Hardware: I7-4710qm+GT940M 2Gide

相關文章
相關標籤/搜索