赞
踩
Traceback (most recent call last): File "d:/data/python/yolo3-keras-master/predict.py", line 15, in <module> yolo = YOLO() File "d:\data\python\yolo3-keras-master\yolo.py", line 52, in __init__ self.boxes, self.scores, self.classes = self.generate() File "d:\data\python\yolo3-keras-master\yolo.py", line 95, in generate self.yolo_model.load_weights(self.model_path) File "D:\app\Anaconda\envs\tensorflow-gpu\lib\site-packages\keras\engine\topology.py", line 2656, in load_weights f, self.layers, reshape=reshape) File "D:\app\Anaconda\envs\tensorflow-gpu\lib\site-packages\keras\engine\topology.py", line 3328, in load_weights_from_hdf5_group original_keras_version = f.attrs['keras_version'].decode('utf8').decode('utf8') AttributeError: 'str' object has no attribute 'decode'
InternalError (see above for traceback): Blas SGEMM launch failed : m=43264, n=32, k=64 [[node conv2d_3/convolution (defined at D:\app\Anaconda\envs\tensorflow-gpu\lib\site-packages\keras\backend\tensorflow_backend.py:3335) ]] [[node boolean_mask_143/GatherV2 (defined at d:\data\python\yolo3-keras-master\nets\yolo3.py:291) ]]
报错原因:
显卡3050,必须使用CUDA11
解决方法:
官网下载CUDA11安装
注意安装路径不要在临时解压文件夹下
官网下载对应版本的cuDNN,解压到……
安装PyTorch,到官网找对CUDD对应版本,复制命令安装
OpenCV: FFMPEG: tag 0x47504a4d/'XVID' is not supported with codec id 7 and format 'mp4 / MP4 (MPEG-4 Part 14)' OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'
1.解决方法
1,将fourcc = cv2.VideoWriter_fourcc(*“XVID”)的"XVID"改成"mp4v"
2021-09-17 08:44:07.044777: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
1.解决方法
1.去官网下载cudart64_101.dll文件,解压。(cuda10的包)放到:D:\app\CUDA GPU Comouting Toolkit\CUDA\v11.4\bin
解决好7-11的问题,最后以上的问题通过升级tensorflow和tensorflow-gpu解决。
CUDA11.4 cudnn11.4 tensorfloe2.4.0 tensorflow-gpu2.4.0
1.报错原因
有这一警告的原因在于,验证码的图片模式为RGBA,是无法分配调色盘给透明通道的。更换为RGB模式则不会出现该问题。
2.解决方法
我使用photoshop进行模式转换的批处理后,还是报错。
I tensorflow/stream_executor/cuda/cuda_driver.cc:789] failed to allocate 1.83G (1968046080 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY: out of memory
1.报错原因
GPU溢出,在代码里限制GPU调用就可以了。
2.解决方法
tf.config.experimental.set_virtual_device_configuration(gpus[0],
[tf.config.experimental.VirtualDeviceConfiguration(memory_limit=2048)])
`Traceback (most recent call last):
File “d:/data/python/yolo3-pytorch-master/train.py”, line 4, in
import numpy as np
File “D:\app\Anaconda\envs\pytorch\lib\site-packages\numpy_init_.py”, line 140, in
from . import core
File “D:\app\Anaconda\envs\pytorch\lib\site-packages\numpy\core_init_.py”, line 48, in
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed: 找不到指定的模块。`
1.解决方法
卸载numpy,再重新安装
安装scipy:pip install scipy
同上
在视频窗口使用esc退出就可以保存。
OSError: [WinError 1455] 页面文件太小,无法完成操作。 Error loading "D:\app\Anaconda\envs\pytorch\lib\site-packages\torch\lib\cudnn_adv_infer64_8.dll" or one of its dependencies.
1.解决问题
在train.py里的num_workers所致。原先值为4,我改成0后成功运行。
RuntimeError: CUDA out of memory. Tried to allocate 18.00 MiB (GPU 0; 4.00 GiB total capacity; 77.77 MiB already allocated; 2.68 GiB free; 86.00 MiB reserved in total by PyTorch)
RuntimeError: [enforce fail at ..\c10\core\CPUAllocator.cpp:79] data. DefaultCPUAllocator: not enough memory: you tried to allocate 18874368 bytes.
TypeError: No matching version. GPU ufunc requires array arguments to have the exact types. This behaves like regular ufunc with casting='no'.
`Process Process-1:
Traceback (most recent call last):
File “D:\app\Anaconda\envs\pytorch\lib\site-packages\numpy\core\fromnumeric.py”, line 1955, in shape
result = a.shape
File “D:\app\Anaconda\envs\pytorch\lib\site-packages\PIL\Image.py”, line 546, in getattr
raise AttributeError(name)
AttributeError: shape
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “D:\app\Anaconda\envs\pytorch\lib\multiprocessing\process.py”, line 258, in _bootstrap
self.run()
File “D:\app\Anaconda\envs\pytorch\lib\multiprocessing\process.py”, line 93, in run
self._target(*self._args, **self._kwargs)
File “d:\data\python\Multi-model-parallel\predict.py”, line 166, in predict
r_image = yolo.detect_image(image)
File “d:\data\python\Multi-model-parallel\YOLO\yolo1.py”, line 211, in detect_image
right = min(np.shape(image)[1], np.floor(right + 0.5).astype(‘int32’))
File “<array_function internals>”, line 6, in shape
File “D:\app\Anaconda\envs\pytorch\lib\site-packages\numpy\core\fromnumeric.py”, line 1957, in shape
result = asarray(a).shape
File “D:\app\Anaconda\envs\pytorch\lib\site-packages\numpy\core_asarray.py”, line 83, in asarray
return array(a, dtype, copy=False, order=order)
File “D:\app\Anaconda\envs\pytorch\lib\site-packages\PIL\Image.py”, line 703, in array
return np.array(ArrayData(), dtype)
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 5.93 MiB for an array with shape (1080, 1920, 3) and data type uint8`
出现该问题一般是由于你在以写模式打开文件后未关闭的情况下又去以读模式操作该文件时报的错误
`def model_a(self,model,images):
outputs = self.netmodel 多进程时,此代码重复执行,用不同网络打开同一张照片造成错误
output_list = []
output_lists = []
batch_detections = []
for i in range(3):
output_list.append(self.yolo_decodes[model]i)
output_lists.extend([output_list])
#---------------------------------------------------------#
# 将预测框进行堆叠,然后进行非极大抑制
#---------------------------------------------------------#
output = torch.cat(output_list, 1)
batch_detections.extend([non_max_suppression(output, self.num_classes[model], conf_thres=self.confidence, nms_thres=self.iou)])
`
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。