bubbliiiing / yolo3-tf2

这是一个yolo3-tf2的源码,可以用于训练自己的模型。
MIT License
80 stars 21 forks source link

运行predict.py,不报错也没生效就退出了 #2

Open jiangcl3089 opened 3 years ago

jiangcl3089 commented 3 years ago

显卡RTX3070+cuda11.0+tensorflow-gpu==2.2.0运行predict.py,加载完网络后,就退出了,这是终端信息 `

& "C:/Program Files/Python37/python.exe" f:/deep_learning/yolo3-tf2-main/predict.py 2021-08-30 16:32:43.960908: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll 2021-08-30 16:32:45.119864: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll 2021-08-30 16:32:45.142270: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: pciBusID: 0000:02:00.0 name: NVIDIA GeForce RTX 3070 computeCapability: 8.6 coreClock: 1.77GHz coreCount: 46 deviceMemorySize: 8.00GiB deviceMemoryBandwidth: 417.29GiB/s 2021-08-30 16:32:45.145004: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll 2021-08-30 16:32:45.163830: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll 2021-08-30 16:32:45.176592: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll 2021-08-30 16:32:45.180403: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll 2021-08-30 16:32:45.187683: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll 2021-08-30 16:32:45.199344: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll 2021-08-30 16:32:45.201125: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll 2021-08-30 16:32:45.202471: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0 2021-08-30 16:32:45.211198: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2021-08-30 16:32:45.218758: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1890a710b80 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2021-08-30 16:32:45.220847: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version 2021-08-30 16:32:45.222354: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: pciBusID: 0000:02:00.0 name: NVIDIA GeForce RTX 3070 computeCapability: 8.6 coreClock: 1.77GHz coreCount: 46 deviceMemorySize: 8.00GiB deviceMemoryBandwidth: 417.29GiB/s 2021-08-30 16:32:45.225497: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll 2021-08-30 16:32:45.227612: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll 2021-08-30 16:32:45.229092: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll 2021-08-30 16:32:45.230572: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll 2021-08-30 16:32:45.232051: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll 2021-08-30 16:32:45.233536: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll 2021-08-30 16:32:45.235486: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll 2021-08-30 16:32:45.237014: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0 2021-08-30 16:32:46.357841: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix: 2021-08-30 16:32:46.359391: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108] 0 2021-08-30 16:32:46.360338: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0: N 2021-08-30 16:32:46.361381: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1247] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6185 MB memory) -> physical GPU (device: 0, name: NVIDIA GeForce RTX 3070, pci bus id: 0000:02:00.0, compute capability: 8.6) 2021-08-30 16:32:46.365969: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x189345b7520 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices: 2021-08-30 16:32:46.368067: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): NVIDIA GeForce RTX 3070, Compute Capability 8.6 model_data/yolo_weights.h5 model, anchors, and classes loaded. Input image filename:img/street.jpg <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1330x1330 at 0x1895CE358D0> -----------------------------------start predict-net PS F:\deep_learning\yolo3-tf2-main>`

我在yolo.py文件144行加入了 `print('-----------------------------------start predict-net')

out_boxes, out_scores, out_classes = self.get_pred(image_data, input_image_shape)

print('-----------------------------------end predict-net')` 从上面打印信息可以看出get_pred方法运行时中断了,我尝试卸载CUDA11.2,装上11.0也是这样,不知道什么情况

jiangcl3089 commented 3 years ago

第一次,不太会贴代码,这是终端信息: `2021-08-30 16:42:45.547851: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll 2021-08-30 16:42:46.724686: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll 2021-08-30 16:42:46.747052: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: pciBusID: 0000:02:00.0 name: NVIDIA GeForce RTX 3070 computeCapability: 8.6 coreClock: 1.77GHz coreCount: 46 deviceMemorySize: 8.00GiB deviceMemoryBandwidth: 417.29GiB/s 2021-08-30 16:42:46.749802: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll 2021-08-30 16:42:46.755313: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll 2021-08-30 16:42:46.759781: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll 2021-08-30 16:42:46.761808: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll 2021-08-30 16:42:46.769180: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll 2021-08-30 16:42:46.772422: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll 2021-08-30 16:42:46.774195: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll 2021-08-30 16:42:46.775548: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0 2021-08-30 16:42:46.784218: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2021-08-30 16:42:46.791426: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x24771e40d30 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2021-08-30 16:42:46.793371: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version 2021-08-30 16:42:46.794737: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: pciBusID: 0000:02:00.0 name: NVIDIA GeForce RTX 3070 computeCapability: 8.6 coreClock: 1.77GHz coreCount: 46 deviceMemorySize: 8.00GiB deviceMemoryBandwidth: 417.29GiB/s 2021-08-30 16:42:46.797436: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll 2021-08-30 16:42:46.798786: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll 2021-08-30 16:42:46.800166: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll 2021-08-30 16:42:46.801755: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll 2021-08-30 16:42:46.803160: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll 2021-08-30 16:42:46.804590: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll 2021-08-30 16:42:46.806145: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll 2021-08-30 16:42:46.807568: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0 2021-08-30 16:42:47.911282: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix: 2021-08-30 16:42:47.912772: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108] 0 2021-08-30 16:42:47.913708: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0: N 2021-08-30 16:42:47.914902: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1247] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6185 MB memory) -> physical GPU (device: 0, name: NVIDIA GeForce RTX 3070, pci bus id: 0000:02:00.0, compute capability: 8.6) 2021-08-30 16:42:47.919701: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x2471f5bc1a0 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:

2021-08-30 16:42:47.922023: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): NVIDIA GeForce RTX 3070, Compute Capability 8.6

model_data/yolo_weights.h5 model, anchors, and classes loaded.

PS F:\deep_learning\yolo3-tf2-main>` 在加载完model就停止了...不知道是不是我cuda的问题,博主用的什么显卡和cuda版本呀?

bubbliiiing commented 3 years ago

我没记错的话应该cuda11要2.4以上吧