Diffusion Tensor Imaging (DTI) and Magnetic Resonance Imaging (MRI) techniques have gained significant popularity in the diagnosis of neurodegenerative disorders. Combining brain scans with deep learning is receiving increasing attention in medical diagnostic applications. However, deep networks can learn powerful features and perform well only when a large amount of DTI or MRI image data are available. The paper attempts to reduce the dependence on massive training data by exploiting transfer learning of deep networks pretrained on ImageNet data for the diagnosis of dementia. Transfer learning can significantly reduce the length of the training, validation and testing process on a new dataset, and is based on the use of pretrained models which have demonstrated better performance than models trained from scratch in several applications. In this context, the paper investigates the potential of transfer learning, which is based on modifications of the AlexNet and VGG16 convolutional neural networks (CNNs), when MRI or DTI data are used for the classification of Mild Cognitive Impairment (MCI), AD and normal patient. Experiments based on data from the ADNI database demonstrate the high performance of the transfer learning methods in the detection of early degenerative changes in the brain. The highest accuracy of 99.75% in the diagnosis of AD was achieved with transfer learning of VGG models using DTI scans. The prediction of early cognitive decline with an accuracy of 93% was reached by VGG models processing MRI data.