YoloV4 - Out of memory

6 ビュー (過去 30 日間)
Thomas Cimiega
Thomas Cimiega 2022 年 12 月 13 日
コメント済み: Thomas Cimiega 2022 年 12 月 21 日
I am trying to run YoloV4 example object detection using yolov4 deep learning on my local computer (GeForce GTX 1060, 16Gb RAM, Windows) using the local .mlx script and get the following error in line 95:
detectionResults = detect(detector,testData);
Error using dlnetwork/predict
Layer 'mish_2': Invalid input data. Error using the predict function in layer nnet.cnn.layer.FunctionLayer. The function
threw an error and could not be executed.
Error in yolov4ObjectDetector>iPredictActivations (line 1152)
[features{:}] = predict(network, dlX, 'Acceleration',acceleration);
Error in yolov4ObjectDetector/predict (line 517)
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 404)
[varargout{1:nargout}] = performDetect(detector, I, params);
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 61)
[varargout{1:layer.NumOutputs}] = feval(layer.PredictFcn, varargin{:});
Of course I researched and tried to decrease the minibatch size to 1 (line 75) or to reset the gpu device according to [1]. I also tried to run this code on different devices like a gpu server with 4 TITAN RTX GPUs, 1TB RAM and Arch Linux. Still the same error.
Do I miss some other settings that could cause this error?

採用された回答

Joss Knight
Joss Knight 2022 年 12 月 17 日
Generally the best solution here is to reduce the size of the input data.
Still, these object detector networks do seem to be unusually large. You could try a smaller one (yolov3tiny?) or you could see if you get good enough performance for your purposes on the CPU.
You could also try the Acceleration="none" option if available to you, since older versions of MATLAB had an issue that would cause memory usage to spike during optimization.
  1 件のコメント
Thomas Cimiega
Thomas Cimiega 2022 年 12 月 21 日
thank you, reducing the size of the input data actually works fine!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDeep Learning with GPU Coder についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by