我使用来自 AI 家伙的仓库的 YOLOv4 自定义函数。一切都完美无缺,包括将权重文件转换为 pb 文件,对图像和视频进行检测,然后在 pc 和 colab 上都会出现此错误:
- 当我只使用 CPU 时,检测在图像和视频数据上运行良好
- 当我使用 GPU 时,检测只在图像上运行。在视频上运行时,它仍然运行,但没有检测到任何东西。我假设检测只在第一帧上运行,而不是在其余帧上。
- 这是在 CPU 上运行视频检测时的控制台日志:
2021-05-01 11:19:05.173287: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcudart.so.11.0 2021-05-01 11:19:07.268691: I tensorflow/compiler /jit/xla_cpu_device.cc:41] 未创建 XLA 设备,未设置 tf_xla_enable_xla_devices 2021-05-01 11:19:07.269701: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcuda.so .1 2021-05-01 11:19:07.279142:E tensorflow/stream_executor/cuda/cuda_driver.cc:328] 调用 cuInit 失败:CUDA_ERROR_NO_DEVICE:未检测到支持 CUDA 的设备 2021-05-01 11:19:07.279180 :我 tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] 内核驱动程序似乎没有在此主机上运行(76ac529fe3d6):/proc/driver/nvidia/version 不存在 2021-05-01 11:19:07.325497 :我张量流/编译器/jit/xla_gpu_device.cc:99] 未创建 XLA 设备,未设置 tf_xla_enable_xla_devices True:False 2021-05-01 11:19:07.328773:I tensorflow/compiler/jit/xla_gpu_device.cc:99] 未创建 XLA 设备,未设置 tf_xla_enable_xla_devices 当前阈值:0.5 2021 -05-01 11:19:23.595602:I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] 未启用 MLIR 优化通道(已注册 2) 2021-05-01 11:19:23.658932:I tensorflow/core /platform/profile_utils/cpu_utils.cc:112] CPU 频率:2299995000 Hz FPS:0.77 找到对象:Noentry,置信度:0.69,BBox 坐标(xmin,ymin,xmax,ymax):380.0、389.0、392.0、397.0 FPS:2.60找到对象:Noentry,置信度:0.68,BBox 坐标(xmin,ymin,xmax,ymax):380.0、389.0、392.0、397.0 FPS:2.38 找到对象:Noentry,置信度:0.69,BBox 坐标(xmin、ymin、xmax、ymax) ):380.0、389.0、392.0、396。0 FPS:2.51 找到对象:Noentry,置信度:0.89,BBox 坐标(xmin,ymin,xmax,ymax):380.0,389.0,391.0,397.0 FPS:2.48 找到对象:Noentry,置信度:0.90,BBox 坐标(xmin,ymin , xmax, ymax): 380.0, 390.0, 391.0, 397.0 FPS: 2.52 找到对象: Noentry, Confidence: 0.90, BBox Coords (xmin, ymin, xmax, ymax): 380.0, 390.0, 391.0, 397.0 FPS: 2.64 找到对象: Noentry, Confidence: 0.87, BBox Coords (xmin, ymin, xmax, ymax): 379.0, 391.0, 390.0, 398.0 FPS: 2.59 Object found: Noentry, Confidence: 0.76, BBox Coords (xmin, ymin, xmax, ymax): 378.0 , 392.0, 390.0, 399.0 FPS: 2.64 找到对象: Noentry, Confidence: 0.75, BBox Coords (xmin, ymin, xmax, ymax): 377.0, 392.0, 390.0, 400.0 FPS: 2.61 Object found: Noentry, Confidence: 0.71, BBox坐标(xmin、ymin、xmax、ymax):377.0、393.0、389.0、401.0 FPS:2.58 FPS:2.66 FPS:2.52 FPS:2.50 FPS:2.57 帧/秒: 2.59 帧/秒: 2.60 帧/秒: 2.75 帧/秒: 2.57 帧/秒: 2.77
- 这是在 GPU 上运行视频检测时的控制台日志(如果日志有点太长,我很抱歉)
2021-05-01 10:32:33.098862: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcudart.so.11.0 2021-05-01 10:32:34.935938: I tensorflow/compiler /jit/xla_cpu_device.cc:41] 未创建 XLA 设备,未设置 tf_xla_enable_xla_devices 2021-05-01 10:32:34.936785: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcuda.so .1 2021-05-01 10:32:34.953709: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从 SysFS 读取的成功 NUMA 节点具有负值 (-1),但必须至少有一个 NUMA 节点,所以返回 NUMA 节点零 2021-05-01 10:32:34.954371: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] 找到具有属性的设备 0:pciBusID:0000:00:04.0 名称:Tesla P100-PCIE -16GB 计算能力:6.0 核心时钟:1。3285GHz coreCount: 56 deviceMemorySize: 15.90GiB deviceMemoryBandwidth: 681.88GiB/s 2021-05-01 10:32:34.954406: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcudart.so.11.0 2021 -05-01 10:32:34.957049: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcublas.so.11 2021-05-01 10:32:34.957129: I tensorflow/stream_executor/ platform/default/dso_loader.cc:49] 成功打开动态库 libcublasLt.so.11 2021-05-01 10:32:34.958917: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcufft .so.10 2021-05-01 10:32:34.959305: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcurand.so.10 2021-05-01 10:32:34.961111:I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcusolver.so.10 2021-05-01 10:32:34.961867: I tensorflow/stream_executor/platform/default/dso_loader.cc:49]成功打开动态库 libcusparse.so.11 2021-05-01 10:32:34.962058: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcudnn.so.8 2021-05-01 10 :32:34.962151: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从 SysFS 读取的成功 NUMA 节点具有负值 (-1),但必须至少有一个 NUMA 节点,因此返回 NUMA 节点为零 2021-05 -01 10:32:34.962729: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从 SysFS 读取的成功 NUMA 节点具有负值 (-1),但必须至少有一个 NUMA 节点,所以返回 NUMA 节点零 2021-05-01 10:32:34.963310: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] 添加可见 gpu 设备:0 2021-05-01 10:32:35.006935: I tensorflow /compiler/jit/xla_gpu_device.cc:99] 未创建 XLA 设备,未设置 tf_xla_enable_xla_devices 2021-05-01 10:32:35.007063: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从 SysFS 读取的 NUMA 节点成功负值(-1),但必须至少有一个NUMA节点,所以返回NUMA节点零 2021-05-01 10:32:35.007689: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] 找到设备0 具有属性:pciBusID:0000:00:04.0 名称:Tesla P100-PCIE-16GB 计算能力:6.0 coreClock:1.3285GHz coreCount:56 deviceMemorySize:15.90GiB deviceMemoryBandwidth:681.88GiB/s 2021-05-01 10:32:35.007719:I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcudart.so.11.0 2021-05-01 10:32:35.007756: I tensorflow/stream_executor/platform/default/dso_loader.cc:49]成功打开动态库 libcublas.so.11 2021-05-01 10:32:35.007781: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcublasLt.so.11 2021-05-01 10 :32:35.007803: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcufft.so.10 2021-05-01 10:32:35.007839: I tensorflow/stream_executor/platform/default/dso_loader .cc:49] 成功打开动态库 libcurand.so.10 2021-05-01 10:32:35.007859: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcusolver.so.10 2021 -05-01 10:32:35.007881: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcusparse.so.11 2021-05-01 10:32:35.007903: I tensorflow/stream_executor/platform/default/dso_loader.cc: 49] 成功打开动态库 libcudnn.so.8 2021-05-01 10:32:35.007991: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从 SysFS 读取的成功 NUMA 节点具有负值 (-1),但是必须至少有一个 NUMA 节点,因此返回 NUMA 节点零 2021-05-01 10:32:35.008575: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从 SysFS 读取的成功 NUMA 节点具有负值(-1 ),但必须至少有一个 NUMA 节点,因此返回 NUMA 节点零 2021-05-01 10:32:35.009095: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] 添加可见 gpu 设备:0 2021 -05-01 10:32:35.009140:I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcudart.so.11.0 2021-05-01 10:32:35.503454: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261]具有强度 1 边缘矩阵的设备互连 StreamExecutor:2021-05-01 10:32:35.503505:I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267] 0 2021-05-01 10:32:35.503515:I tensorflow/ core/common_runtime/gpu/gpu_device.cc:1280] 0: N 2021-05-01 10:32:35.503690: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从 SysFS 读取的成功 NUMA 节点具有负值(- 1),但必须至少有一个NUMA节点,因此返回NUMA节点零 2021-05-01 10:32:35.504369: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从SysFS读取的成功NUMA节点是否定的值(-1),但必须至少有一个 NUMA 节点,因此返回 NUMA 节点零 2021-05-01 10:32:35.504897: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从 SysFS 读取的成功 NUMA 节点具有负值(- 1),但必须至少有一个NUMA节点,所以返回NUMA节点为零 2021-05-01 10:32:35.505452: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1406] Created TensorFlow device (/job :localhost/replica:0/task:0/device:GPU:0 具有 14975 MB 内存)-> 物理 GPU(设备:0,名称:Tesla P100-PCIE-16GB,pci 总线 ID:0000:00:04.0,计算能力:6.0)真:假 2021-05-01 10:32:35.506749:我 tensorflow/compiler/jit/xla_gpu_device.cc:99] 未创建 XLA 设备,未设置 tf_xla_enable_xla_devices 2021-05-01 10:32:35.506845:我张量流/stream_executor/cuda/cuda_gpu_executor.cc:941] 从 SysFS 读取的成功 NUMA 节点具有负值 (-1),但必须至少有一个 NUMA 节点,因此返回 NUMA 节点零 2021-05-01 10:32:35.507388: I tensorflow/core/common_runtime/gpu /gpu_device.cc:1720] 找到具有属性的设备 0:pciBusID:0000:00:04.0 名称:Tesla P100-PCIE-16GB 计算能力:6.0 coreClock:1.3285GHz coreCount:56 deviceMemorySize:15.90GiB deviceMemoryBandwidth:681.88GiB/s 2021- 05-01 10:32:35.507418: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcudart.so.11.0 2021-05-01 10:32:35.507459: I tensorflow/stream_executor/platform /default/dso_loader.cc:49] 成功打开动态库 libcublas.so.11 2021-05-01 10:32:35.507472: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcublasLt.所以。11 2021-05-01 10:32:35.507485: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcufft.so.10 2021-05-01 10:32:35.507497: I tensorflow/ stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcurand.so.10 2021-05-01 10:32:35.507512: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcusolver.so.10 2021-05-01 10:32:35.507524: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcusparse.so.11 2021-05-01 10:32: 35.507536: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcudnn.so.8 2021-05-01 10:32:35.507582: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从 SysFS 读取的成功 NUMA 节点具有负值 (-1),但必须至少有一个 NUMA 节点,因此返回 NUMA 节点零 2021-05-01 10:32:35.508113: I tensorflow/stream_executor/cuda/cuda_gpu_executor .cc:941] 从 SysFS 读取的成功 NUMA 节点为负值 (-1),但必须至少有一个 NUMA 节点,因此返回 NUMA 节点为零 2021-05-01 10:32:35.508604: I tensorflow/core/ common_runtime/gpu/gpu_device.cc:1862] 添加可见 gpu 设备:0 2021-05-01 10:32:35.508630: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261] 设备互连 StreamExecutor 与强度 1 边缘矩阵: 2021-05-01 10:32:35.508640: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267] 0 2021-05-01 10:32:35.508647: I tensorflow/core/common_runtime/gpu/gpu_device。 cc:1280] 0: N 2021-05-01 10:32:35.508710:我 tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从 SysFS 读取的成功 NUMA 节点有负值(-1),但必须至少有一个 NUMA 节点,所以返回 NUMA 节点为零 2021-05-01 10:32 :35.509240: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] 从SysFS读取的成功NUMA节点为负值(-1),但必须至少有一个NUMA节点,因此返回NUMA节点为零 2021-05-01 10:32:35.509738:我 tensorflow/core/common_runtime/gpu/gpu_device.cc:1406] 创建了 TensorFlow 设备(/job:localhost/replica:0/task:0/device:GPU:0,内存为 14975 MB)->物理 GPU(设备:0,名称:Tesla P100-PCIE-16GB,pci 总线 id:0000:00:04.0,计算能力:6.0)当前阈值:0.5 2021-05-01 10:32:50.238825:I tensorflow/compiler /mlir/mlir_graph_optimization_pass.cc:116] MLIR 优化通道均未启用(注册 2) 2021-05-01 10:32:50.290412:I tensorflow/core/platform/profile_utils/cpu_utils.cc:112] CPU 频率:2199995000 Hz 2021-05-01 10:32:50.932916: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcudnn.so.8 2021-05-01 10:32:51.960900: I tensorflow/stream_executor/platform/default/ dso_loader.cc:49] 成功打开动态库 libcublas.so.11 2021-05-01 10:32:52.189146: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] 成功打开动态库 libcublasLt.so.11 FPS:0.41 FPS:23.86 FPS:23.61 FPS:24.18 FPS:23.84 FPS:23.82 FPS:24.36 FPS:23.82 FPS:24.10 FPS:24.39 FPS:24.17 FPS:24.09 FPS:24.54 FPS:24.54 FPS:23.93 FPS:23.93 FPS 24.11 帧/秒:24.48 帧/秒:24.10 帧/秒:24.29 帧/秒:24.46 帧/秒:24。48 FPS: 23.62 FPS: 23.79 FPS: 23.76 FPS: 24.01 FPS: 24.43 FPS: 23.52 FPS: 24.46 FPS: 24.13 FPS: 24.11 FPS: 23.79 FPS: 24.62 FPS: 24.32 FPS: 24.06 FPS: 24.51 FPS: 24.46 FPS: 24.40 FPS : 24.48 FPS: 24.62 视频结束
起初我认为我的 GPU 不够强大(GTX 1050 移动版),但即使在使用 Tesla V100 的 colab pro 上运行时也会发生这种情况,我感谢任何帮助。