Tensorflow 运行命令python object_detection_tutorial.py 测试模型,不报错直接结束的问题
1.今天设置object_detection_tutorial.py 模型、图片等路径。
PATH_TO_TEST_IMAGES_DIR = 'C:\\Users\\Administrator\\tensorflow\\research\\object_detection\\img_test\\prove\\' //图片路径
PATH_TO_LABELS = os.path.join('tensorflow_625', 'pascal_label.pbtxt') //pbtxt路径
2.运行命令python object_detection_tutorial.py,出现无报错直接结束。
2021-07-05 11:10:48.133004: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0
2021-07-05 11:10:48.134138: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N
2021-07-05 11:10:48.135391: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 8686 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080 Ti, pci bus id: 0000:b3:00.0, compute capability: 7.5)
(tenflow_gpu) C:\Users\Administrator>tensorflow\research\object_detection> //无报错直接结束
3.查看object_detection_tutorial.py文件,发现是pbtxt的路径名称少写了一位导致路径错误。
PATH_TO_LABELS = os.path.join('tensorflow_625', 'pascal_label.pbtxt') //正确路径为tensorflow_0625
4.修改正确路径。
PATH_TO_LABELS = os.path.join('tensorflow_0625', 'pascal_label.pbtxt')
5.运行命令python object_detection_tutorial.py,正常运行。
2021-07-05 11:10:48.115073: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
2021-07-05 11:10:48.117006: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_100.dll
2021-07-05 11:10:48.118830: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_100.dll
2021-07-05 11:10:48.120810: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_100.dll
2021-07-05 11:10:48.122647: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_100.dll
2021-07-05 11:10:48.124493: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_100.dll
2021-07-05 11:10:48.126436: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2021-07-05 11:10:48.128240: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2021-07-05 11:10:48.129716: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-07-05 11:10:48.133004: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0
2021-07-05 11:10:48.134138: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N
2021-07-05 11:10:48.135391: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 8686 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080 Ti, pci bus id: 0000:b3:00.0, compute capability: 7.5)