Error with"HelperGenerateSpeechDenoisingFeatures"
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
To use Deep learning to denoise.
It told me that i use Tall array in wrong way. Now , i am afraid that there is nothing i can do about it .
I was trying out the Denoise Speech Using Deep Learning Networks example with some modifications. I just set the noise and dataset as local path, and deleted the very first part. Because i didn't need to play the sound that i had already known and i thought it was not as important as the next step.
the part that i changed is here
%changed
noisedataset = "D:\matlab_network\zh-CN\cv-corpus-5.1-2020-06-22\zh-CN\nosie\common_voice_zh-CN_18527375.mp3";
[noise,fs] = audioread(noisedataset);
dataset = "D:\matlab_network\zh-CN\cv-corpus-5.1-2020-06-22\zh-CN";
adsTrain = audioDatastore(fullfile(dataset,"clips"),IncludeSubfolders=true);
speedupExample = true;
if speedupExample
adsTrain = shuffle(adsTrain);
adsTrain = subset(adsTrain,1:1000);
end
----------------------------------------------------------------------
%STFT
windowLength = 256;
win = hamming(windowLength,"periodic");
.......
Where the error was reported
%tall数组
%-------error
reset(adsTrain)
T = tall(adsTrain);
[targets,predictors] = cellfun(@(x)HelperGenerateSpeechDenoisingFeatures(x,noise,src),T,UniformOutput=false);
[targets,predictors] = gather(targets,predictors);
%----- error
predictors = cat(3,predictors{:});
noisyMean = mean(predictors(:));
noisyStd = std(predictors(:));
predictors(:) = (predictors(:) - noisyMean)/noisyStd;
targets = cat(2,targets{:});
cleanMean = mean(targets(:));
cleanStd = std(targets(:));
targets(:) = (targets(:) - cleanMean)/cleanStd;
predictors = reshape(predictors,size(predictors,1),size(predictors,2),1,size(predictors,3));
targets = reshape(targets,1,1,size(targets,1),size(targets,2));
However, i met the problem like this. I get this error all the time and i am stuck in this problem for a long time. I get no idea to deal with it. I was wondering if anyone could give me a hand? Thank you in advance.
错误使用 tall
无法根据默认并行集群创建 mapreduce 执行环境。
出错 restart (第 93 行)
T = tall(adsTrain);
原因:
错误使用 gcp
Parallel pool failed to start with the following error. For more detailed information, validate
the profile 'Processes' in the Cluster Profile Manager.
错误使用 parallel.internal.pool.AbstractInteractiveClient>iThrowWithCause
Failed to initialize the interactive session.
错误使用 parallel.internal.pool.AbstractInteractiveClient>iThrowIfBadParallelJobStatus
The interactive communicating job failed with no message.
0 comentarios
Respuestas (1)
Brian Hemmat
el 30 de Mzo. de 2024
Based on the error message, it looks like a problem with the parallel setup. Did you try validating the profile "Processes" in the "Cluster Profile Manager"?
Another option is to bypass the usage of tall. The following modification can help:
Replace this code:
T = tall(adsTrain);
[targets,predictors] = cellfun(@(x)HelperGenerateSpeechDenoisingFeatures(x,noise,src),T,UniformOutput=false);
[targets,predictors] = gather(targets,predictors);
With this:
tadsTrain = transform(adsTrain,@(x)HelperGenerateSpeechDenoisingFeatures(x,noise,src));
allresults = readall(tadsTrain); % Possibly use the UseParallel flag to speed up--probably not necessary if you're patient
targets = allresults(:,1);
predictors = allresults(:,2);
You must also make the following change to the supporting function, HelperGenerateSpeechDenoisingFeatures.m. This change might require other modifications in the example--I haven't didn't run it all the way through.
function out = HelperGenerateSpeechDenoisingFeatures(audio,noise,src) %<<<<<<< Modify the signature to return "out"
% HelperGenerateSpeechDenoisingFeatures: Get target and predictor STFT
% signals for speech denoising.
% audio: Input audio signal
% noise: Input noise signal
% src: Sample rate converter
% Copyright 2018 The MathWorks, Inc.
WindowLength = 256;
win = hamming(WindowLength,'periodic');
Overlap = round(0.75 * WindowLength);
FFTLength = WindowLength;
NumFeatures = FFTLength/2 + 1;
NumSegments = 8;
D = 48/8; % Decimation factor
L = floor( numel(audio)/D);
audio = audio(1:D*L);
audio = src(audio);
reset(src)
randind = randi(numel(noise) - numel(audio) , [1 1]);
noiseSegment = noise(randind : randind + numel(audio) - 1);
noisePower = sum(noiseSegment.^2);
cleanPower = sum(audio.^2);
noiseSegment = noiseSegment .* sqrt(cleanPower/noisePower);
noisyAudio = audio + noiseSegment;
cleanSTFT = stft(audio, 'Window',win, 'OverlapLength', Overlap, 'FFTLength',FFTLength);
cleanSTFT = abs(cleanSTFT(NumFeatures-1:end,:));
noisySTFT = stft(noisyAudio, 'Window',win, 'OverlapLength', Overlap, 'FFTLength',FFTLength);
noisySTFT = abs(noisySTFT(NumFeatures-1:end,:));
noisySTFTAugmented = [noisySTFT(:,1:NumSegments-1) noisySTFT];
STFTSegments = zeros(NumFeatures, NumSegments , size(noisySTFTAugmented,2) - NumSegments + 1);
for index = 1 : size(noisySTFTAugmented,2) - NumSegments + 1
STFTSegments(:,:,index) = noisySTFTAugmented(:,index:index+NumSegments-1);
end
targets = cleanSTFT;
predictors = STFTSegments;
out = {targets,predictors}; % <<<<<<<<< Add this line. It combines the targets and predictors into a single output
1 comentario
Ver también
Categorías
Más información sobre AI for Audio en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!