Diabetic retinopathy is the most common cause of blindness of the eye depend on diabetes. For this reason, early detection of diabetic retinopathy is of critical importance. In this study, a deep learning-based approach is presented for the early detection of diabetic retinopathy from retinal images. The proposed approach consists of two steps. In the first stage, pretreatments were performed to remove retinal images from different data sets and standardize them to size. In the second stage, classification was made by Convolutional Neural Network which is a deep learning algorithm and 98.5% success was achieved. The most prominent difference of this study from similar studies is that instead of creating the feature set manually as in traditional methods, the deep learning network automatically constructs itself in a very short time by using the CPU and GPU in training phase.