r = s \[Function] i \[Function] ImageResize[i, s];
ab = ColorSeparate[#, "LAB"][[2 ;;]] &;
out = ImageData /@ ab[# // r@{56, 56}] &;
imgs = Import /@ FileNames["*.jpg", dir, 2]; (*dir = somewhere on my disk*)
data = Table[i -> out@i, {i, imgs}];
raw = NetModel[
"Colorful Image Colorization Trained on ImageNet Competition Data",
"UninitializedEvaluationNet"
];
nex = NetTrain[raw, data, TargetDevice -> "GPU"]
performs training but produces results that fail to colorize no matter what. (All experiences described are same with/without TargetDevice -> "GPU"
.)
The LAB
A
and B
channels the above produces after training are always empty.
- Using
NetInitialize[raw]
before training does not help. NetModel["Colorful Image Colorization Trained on ImageNet Competition \ Data", "Properties"]
has noTrainingNetwork
UninitializedTrainingNetwork
raw = NetModel[
"Colorful Image Colorization Trained on ImageNet Competition Data",
"EvaluationNet"
];
nex = NetTrain[raw, data, TargetDevice -> "GPU"]
produces different results but it is not clear to me what this does.
- Does the above continue training an already-trained
EvaluationNetwork
? - Is there a way to discard the memory of a neural network to have it start training from scratch?
"UninitializedEvaluationNet"
fromNetModel
for that network the same way you're currently getting"EvaluationNet
. Further,NetInitialize[net, All]
will reset all trainable weights in the net including those already trained, whileNetInitialize[net]
will initialize only weights that have not yet been trained. $\endgroup$"UninitializedEvaluationNet"
produces empty zero-valued ImageData as outputs for theLAB
A
andB
channels as mentioned in my question. I will tryNetInitialize[net, All]
now and let you know. $\endgroup$