That appears to be extracted from https://www.mathworks.com/help/nnet/examples/transfer-learning-using-alexnet.html
When I run the code in R2017b I do not see any error message.
validationImages is a variable that is defined near the top of that example.