Error using gpuArray in yolov4Obje​ctDetector​/detect

i am trying train yolov4ObjectDetector, then i follow in this link https://www.mathworks.com/help/vision/ug/object-detection-using-yolov4-deep-learning.html. There is an error on line 117 about "detect" function.
Error using dlnetwork/predict
Layer 'mish_2': Invalid input data. Error using 'predict' in layer nnet.cnn.layer.FunctionLayer. The function threw an error and could not be
executed.
Error in yolov4ObjectDetector>iPredictActivations (line 1153)
[features{:}] = predict(network, dlX, 'Acceleration',acceleration);
Error in yolov4ObjectDetector/predict (line 515)
features = iPredictActivations(network, imgBatch, anchorBoxes, predictParams.Acceleration);
Error in vision.internal.detector.ObjectDetector/performDetect (line 72)
features = this.predict(Ipreprocessed, params);
Error in yolov4ObjectDetector/detect (line 402)
[varargout{1:nargout}] = performDetect(detector, I, params);
Error in cobaan (line 117)
detectionResults = detect(detector,testData);
Caused by:
Error using gpuArray/max
Out of memory on device. To view more detail about available memory on the GPU, use 'gpuDevice()'. If the problem persists, reset the GPU by
calling 'gpuDevice(1)'.
Error in dlarray/max (line 96)
zdata = max(matlab.lang.internal.move(xdata), matlab.lang.internal.move(ydata), varargin{:});
Error in vision.cnn.mish (line 22)
Z1 = max(X,0) + log(1 + exp(-abs(X)));
Error in nnet.cnn.layer.FunctionLayer/predict (line 58)
[varargout{1:layer.NumOutputs}] = feval(layer.PredictFcn, varargin{:});
I've tried changing the mini batch size value but the error shows the same. Any solution?

4 commentaires

reduce the minibatch to 1.
If it still fails then your gpu might be too small to run that.
CUDADevice with properties:
Name: 'NVIDIA GeForce RTX 2080'
Index: 1
ComputeCapability: '7.5'
SupportsDouble: 1
DriverVersion: 11.6000
ToolkitVersion: 11.2000
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.1475e+09 65535 65535]
SIMDWidth: 32
TotalMemory: 8.5895e+09
AvailableMemory: 7.3095e+09
MultiprocessorCount: 46
ClockRateKHz: 1800000
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
CanMapHostMemory: 1
DeviceSupported: 1
DeviceAvailable: 1
DeviceSelected: 1
my GPU device details
https://github.com/ultralytics/yolov3/issues/1155 contains a report from someone who found that minibatch size of 2 with yolov4 was too much for their 2080. There are some suggestions there, but it is not clear to me that those suggestions are relevant to MATLAB.
Hi Anisa and Walter. Mine got the same problem, however i am using GPU 3080Ti 12GB and only runs on 1 minibatch. Is it considered too low too? The problem occur after training, which is during evaluation.

Connectez-vous pour commenter.

Réponses (1)

Kursat CEVIK
Kursat CEVIK le 19 Oct 2022

0 votes

I'm having this problem, is there a solution?

Produits

Version

R2022a

Commenté :

le 10 Déc 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by