Error saying ''Dot Indexing is not supported for variables of this type".

Iam studying about ''Unsupervised Day to Dusk image translation using UNIT''.Source code is given in below link.
I executed the code in MATLAB R2022a.While training It shows me an error indicating "Dot indexing is not supported for variables of this type" in adamupdate built-in function (line 152) , deep.internal.networkContainerFixedArgsFun (line 29) and in deep.internal.recording.containerfeval ((line 38,194,358,460). So I analzed all functions and guessed that the actual error is in line 460 and I have attached the corresponding code below. I tried to resolve the error by modifying the below code but it shows "Access denied".
function args = iTablesToCells(args)
% Convert a set of tables to cell arrays of arguments.
if ~isempty(args)
% Extract Value cell arrays from inputs
for input=1:numel(args)
args{input} = args{input}.Value;
end
end
end
So I can't able to modify the built-in source code "deep.internal.recording.containerfeval" (This function is called inside "deep.internal.networkContainerFixedArgsFun" and this "deep.internal.networkContainerFixedArgsFun" function is called inside adamupdate function). Please tell me where the actual error resides and help me in resolving the above stated error.

6 Kommentare

Check the variables args,,,,,,is it a cell array? If it is a cell is cell, is each cell a structure? If so, do the structure have field named Value?
Variable args is of prototype table and value represents each row value inside table.
For whatever it is worth:
I ran the example in R2022a on my Mac and had no problem.
That suggests that possibly there is some third-party file in your path that is interfering.
Experiment with
restoredefaultpath;rehash toolboxcache
and running the code again. It it works that time then you have some program in your path that is interfering.
Ok sir,Thank you.Is GPU required for this training process? Please tell which GPU type you used for this training. Because using CUDA enabled NVIDIA GPU, it will take 4 days to train the entire network and also tell how to save the trained network.Thank you for your time.
I ran it without gpu, but I did not tell it to train the network

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Image Analyst
Image Analyst am 5 Dez. 2022
Bearbeitet: Image Analyst am 5 Dez. 2022
@Sowparnika and @Sowparnika R S It doesn't make any sense to have a function to extract contents/variables out of a cell array, args, just to put it back in the same cell array as output.
You need to know what to expect. For example if args contains an image, and optionally a threshold value, then you could do this:
function [imageArray, thresholdValue] = iTablesToCells(args)
% Convert a set of tables to cell arrays of arguments.
% Initialize.
imageArray = [];
thresholdValue = 0;
if isempty(args)
return;
end
if numel(args) >= 1
% Extract the image array out of the first cell.
imageArray = args{1};
end
if numel(args) >= 2
% Extract the threshold value out of the second cell.
thresholdValue = args{2};
end
DON'T use input, or any other built-in function name as the name for one of your variables.
Joss Knight
Joss Knight am 17 Dez. 2022
This could be a bug, especially if you didn't modify the example code. What is the data you passed to adamupdate?

11 Kommentare

The parameters are discriminator network (discday),and calculated gradients using dlfeval and dlgradient function.I have inserted the code.
[discDusk,discDuskAvgGradient,discDuskAvgGradientSq] = adamupdate(discDusk,discDuskGrads, discDuskAvgGradient,discDuskAvgGradientSq,iteration,learnRate,gradDecay,sqGradDecay);
The same line of code executed without error while updating parameters of the generator( using same adamupdate function).
Can you confirm that discDuskGrads is a table with all the same entries as discDusk.Learnables?
yes sir,discDuskGrads is table but discDuskAvgGradient is not table, it's double.
Joss Knight
Joss Knight am 18 Dez. 2022
Bearbeitet: Joss Knight am 18 Dez. 2022
Does discDuskGrads have the same rows and variable names as discDusk.Learnables?
Sir I have shared images of both discduskGrads and discdusk network which contains learnables
Well, that looks okay. You might have to contact support.
Since you're debugging the code, what is in args{input} when the error occurs? Is it just an empty array? If I were debugging I'd want to look back up the call stack to try to find out why the entry is empty.
When the error occurs discDuskAvgGradient field value is empty and it's datatype is double, it's not table.So the function is not supporting conversion of table to cell.Is this right sir!. Thank you for your reply.
Well, discDuskAvgGradient and discDuskAvgGradientSq are supposed to be empty on the first update, that's fine, but on the second update they should be tables same as the gradients.
yes sir,but discDuskAvgGradient remains empty (double data type) after the first update.
Using the debugger, step through the code and check that after you first call adamupdate, discDuskAvgGradient is non-empty. Then step through the code and make sure that that value is not deleted before the next call.
Ok sir,will check.

Melden Sie sich an, um zu kommentieren.

Kategorien

Gefragt:

am 5 Dez. 2022

Kommentiert:

am 21 Dez. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by