2019b warnings popping up never had this before with 2019a

Hi all,
I have been running my code and processing stuff normally with matlab until I upgraded to 2019b
can some one help me solve this error please?
Warning: PNG library warning: iCCP: profile 'ICC Profile': 0h: PCS illuminant is not D50.
Everything worked perfect until i hit the upgrade button!
now everything is arguing!
Help Please!

15 Comments

Can you attach a png image for which this warning is thrown?
In any case, it's just a warning telling you that something is not quite right with the colour profile embedded in your image. It's possible that 2019a didn't check for it and so didn't warn you.
Like all warnings, it's easily turned off.
Ahhhhh I see! i will check now and respone to you, thanx for acknowledging me!
when you say the colour profile embedded in my images what are you specifying?
everything seems ok with the colour of my images there are all RGB 277 277 3 jpgs!
is there a way to demonstrate such to me so that i can go to error and fix it? I am uncerating of the jargan and won't want to mess this up because of the lack of my knowledge!
please assist once more!
Comment by Matpar originally posted as an answer moved here:
Hi Guillaume,
It is the augmented step 10 that is causing the issue can you guide me please? this in 2019a work fine? now this is causing the argument!
%% Extract region proposals with selective search
%% Conducting Feature Extraction With RCNN
%% Classifing Features With SVM
%% Improving The Bounding Box
clc
clearvars
clear
close all
%% Step 1 Creating Filenames /Loading Data
anet = alexnet
load('Wgtruth.mat');
load('anet.mat');
save Wgtruth.mat Wgtruth;
save test16.mat;
save anet.mat anet;
load('test16.mat', 'Wgtruth', 'anet');
%% Step 2 Highlighting Image Input Size
inputSize = anet.Layers(1).InputSize;
anet.Layers;
total_images = size(Wgtruth,1);
%% Step 3 Adding Image Directory For Path To Image Data
imDir = '/Users/mmgp/Documents/MATLAB/2020/RCNN/Wgtruth'
addpath(imDir)
% imDir = fullfile(matlabroot, 'toolbox', 'vision', 'visiondata','Wgtruth');
% addpath(imDir);
%% Step 4 Accessing Contents Of Folder TrainingSet Using Datastore
imds =imageDatastore(imDir,'IncludeSubFolders',true,'LabelSource','Foldernames');
%% Step 5 Splitting Inputs Into Training and Testing Sets
[imdsTrain,imdsValidation] = splitEachLabel(imds,0.7,'randomized');
%% Step 6 Replacing Final Layer/Last 3 Configure For Network classes
% Complex Architecture Layers Has Inputs/Outputs From Multiple Layers
% Finetuning These 3 Layers For New Classification
% Extracting All Layers Except The Last 3
layersTransfer = anet.Layers(1:end-3)
%% Step 7 Specifying Image Categories/Clases From 1000 to Gun(One Class):
numClasses = numel(categories(imdsTrain.Labels));
Tlayers = [
layersTransfer
fullyConnectedLayer(numClasses,'Name','fc8','WeightLearnRateFactor',10,'BiasLearnRateFactor',10);
softmaxLayer('name', 'Softmax')
classificationLayer('Name','ClassfLay')]
%% Step 8 Displaying and Visualising Layer Features Of FC8
% layer(16) = maxPooling2dLayer(5,'stride',2)
% disp(Tlayers)
% layer = 22;
% channels = 1:30;
% I = deepDreamImage(net,layer,channels,'PyramidLevels',1);
% figure
% I = imtile(I,'ThumbnailSize',[64 64]);
% imshow(I)
% name = net.Layers(layer).Name;
% title(['Layer ',name,' Features'])
%% Warp Image & Pixel Labels
% Creates A Randomized 2-D Affine Transformation From A Combination Of Rotation,
% Translation, Scaling (Resizing), Reflection, And Shearing
% Rotate Input Properties By An Angle Selected Randomly From Range [-50,50] Degrees.
%% Step 9 Setting Output Function(images may have size variation resizing for consistency with pretrain net)
pixelRange = [-70 70]
imageAugmenter = imageDataAugmenter('RandRotation',[-70 70],...
'RandXReflection',true,...
'RandYReflection',true,...
'RandXShear',pixelRange,...
'RandYShear',pixelRange,...
'RandXTranslation',pixelRange, ...
'RandYTranslation',pixelRange),...
augimdsTrain = augmentedImageDatastore(inputSize(1:2),imdsTrain, ...
'DataAugmentation',imageAugmenter);
%% Step 10 Resizing Images, Assists With Preventing Overfitting
% Utilising Data Augmentation For Resizing Validation Data
% Implemented Without Specifying Overfit Prevention Procedures
% By Not Specifying These Procedures The System Will Be Precise Via
% Predicitons Data Augmentation Prevent The Network From
% Overfitting/ MemorizingExact Details Of Training Images
augmentedTrainingSet = augmentedImageDatastore(inputSize ,imdsTrain,'ColorPreprocessing', 'gray2rgb')
augimdsValidation = augmentedImageDatastore(inputSize,imdsValidation,'ColorPreprocessing', 'gray2rgb')
%% Step 11 Specifying Training Options
% Keep features from earlier layers of pretrained networked for transfer learning
% Specify epoch training cycle, the mini-batch size and validation data
% Validate the network for each iteration during training.
% (SGDM)groups the full dataset into disjoint mini-batches This reaches convergence faster
% as it updates the network's weight value more frequently and increases the
% computationl speed
% Implementing **WITH** The RCNN Object Detector
options = trainingOptions('sgdm',...
'Momentum',0.9,...
'InitialLearnRate', 1e-4,...
'LearnRateSchedule', 'piecewise', ...
'LearnRateDropFactor', 0.1, ...
'Shuffle','every-epoch', ...
'LearnRateDropPeriod', 8, ...
'L2Regularization', 1e-4, ...
'MaxEpochs', 10,...
'MiniBatchSize',80,...
'Verbose', true)
%% Step 12 Training network Consisting Of Transferred & New Layers.
netTransfer = trainNetwork(augmentedTrainingSet,Tlayers,options)
rcnn = trainRCNNObjectDetector(Wgtruth, netTransfer, options, 'NegativeOverlapRange', [0 0.3]);
save('rcnn.mat', 'rcnn')
%% Predicitng Validation Image Accuracy
predictedLabels = classify(netTransfer,augimdsValidation)
accuracy =mean(predictedLabels== imdsValidation.Labels)
%% Step 13 Testing R-CNN Detector On Test Image.
img = imread('11.jpg');
[bbox, score, label] = detect(rcnn, img, 'MiniBatchSize', 80)
% numObservations = 4;
% images = repelem({img},numObservations,1)
% bboxes = repelem({bbox},numObservations,1)
% labels = repelem({label},numObservations,1)
%% Step 14 Displaying Strongest Detection Results.
[score, idx] = max(score)
bbox = bbox(idx, :)
annotation = sprintf('%s: (Confidence = %f)', label(idx), score)
detectedImg = insertObjectAnnotation(img, 'rectangle', bbox, annotation);
figure
imshow(detectedImg)
%
As I said, attach an image that causes the warning to appear, I don't think it has anything to do with your code.
One of your png image includes an ICC profile as part of its metadata. This does not affect the RGB values of your image so yes when you look at the image everything will be fine. The ICC profile would be used if you wanted to convert the image to a different device-dependent colour space such as CMYK for professional printing. All the warning is telling you is that ICC profile is not as expected. If you're not doing any colour conversion you don't have to worry about the profile and can ignore the warning safely. Hence, why it's a warning. Some people will care about it, others won't
If you attach an example image I can tell you exactly how to turn it off. Otherwise, you'd have to do:
imread('C:\somewhere\problematic_image.png');
%At this point you should get the warning
[~, warnid] = lastwarn; %get identifier of warning
warning('off', warnid); %turn warning off
Comment by Matpar originally posted as an answer moved here:
Hi Guillaume and thanks for responding,
This piece of code is what I am trying to alter the size is 28 28 1
I am trying to get the augementation process to see this as 277 277 3
idx = randperm(size(XimdsTrain,4),3000)
XimdsValidation = XimdsTrain(:,:,[1 1 1])
XimdsTrain(:,:,[1 1 1]) = []
YimdsValidation = YimdsTrain(:,:,[1 1 1])
YimdsTrain(idx) = []
This is the original code!!
idx = randperm(size(XTrain,4),1000);
XValidation = XTrain(:,:,:,idx);
XTrain(:,:,:,idx) = [];
YValidation = YTrain(idx);
YTrain(idx) = [];
is it possible for you assist with this as well?
Please see image,
Please, don't answer your own question. Click Comment on this question instead. If people see that your question already has answers, there's less chance they'll look at it.
The warning comes from a png image. The image you've attached is a jpeg image. Please attach the image that causes the warning to appear.
The code you've posted is not related to the warning.
Ohh sorry my friend my bad,
I am so anxious to get the help it is not usual to have someone respond to me so quickly! forgive me!
the images are coming from here and I check all of them are jpg!
I even rename all of them as well to prevent the issue based on your advice a while ago!
I have no png images, all are stored in one folder in one location! the example I posted last is of the same nature, white background images of hand guns!
%% Step 3 Adding Image Directory For Path To Image Data
imDir = fullfile(matlabroot, 'toolbox', 'vision', 'visiondata','Wgtruth')
addpath(imDir)
If your images are jpeg, then I can't explain the warning. It clearly states that it comes from the PNG library, which is only used to read png images. It's a completely different library that's used to read jpeg images.
Anyway, as I said, once you've received the warning do:
[~, warnid] = lastwarn; %get identifier of warning
warning('off', warnid); %turn warning off
to turn it off.
... or just ignore it, it doesn't affect any of your code.
Unrelated to this, you should not put your images in any folder under matlabroot (such as toolbox/vision/visiondata). You run a real risk of messing up matlab to the point you have to reinstall it. Your earlier storage folder /Users/mmgp/Documents/MATLAB/2020/RCNN/Wgtruth was much better.
Ok gotcha,
Will execute now!
Thank you for responding rapiddly it was grately appreaciated!
@Guillaume I took the liberty of inserting 'not' in your comment (original text below):
"Unrelated to this, you should put your images in any folder under Matlab root"
This is where I have all my images but the error persist!
thanx for responding Rik
@rik, Oops unfortunate typo! Thanks for fixing it.
Comment by Matpar originally posted as an answer moved here:
Hi all,
these warnings are fiercely persistant!
I am trying to get the classification process completed but this is my error for which I am having some challenges interpreting!
Warning: Unable to find any region proposals to use as positive training samples. Lower the first value of PositiveOverlapRange to increase the number of positive region proposals.
> In vision.internal.rcnn.BBoxTrainingDataDispatcher (line 127)
In rcnnObjectDetector.trainBBoxRegressor (line 279)
In rcnnObjectDetector.train (line 261)
In trainRCNNObjectDetector (line 268)
In test17 (line 137)
Can a professional help me solve the highlighted?
Thanx in advance for acknowledging my novice approach!
You won't get any professional help here I'm afraid, we're all volunteers.
This is a completely different warning. The previous warning was issued when you loaded an image with some unexpected metadata. Unless you were using the embedded ICC profile (you'd know if you were), you can safely ignore/disable it.
This new warning looks a lot more serious. It looks like it's telling you that one of your training doesn't have any recognisable training data, so most likely you need to review your training data and/or your detection algorithm. I don't have the required toolbox so can't help you any further.

Sign in to comment.

Answers (1)

I've seen this warning in 19b too! Not sure if there is a change to the PNG library being used or if my image is corrupt/out of spec. Please contact support with the offending image.

Categories

Asked:

on 12 Feb 2020

Commented:

on 13 Feb 2020

Community Treasure Hunt

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

Start Hunting!