This paper presents a study on connection-blocking prediction in Elastic Optical Networks (EONs) using Convolutional Neural Networks (CNNs). In EONs, connections are established and torn down dynamically to fulfill the instantaneous requirements of the users. The dynamic allocation of the connections may cause spectrum fragmentation and lead to network performance degradation as connection blocking increases. Predicting potential blocking situations can be helpful during EON operations. For example, this prediction could be used in real networks to trigger proper spectrum defragmentation mechanisms at suitable moments, thereby enhancing network performance. Extensive simulations over the well-known NSFNET (National Science Foundation Network) backbone network topology were run by generating realistic traffic patterns. The obtained results are later used to train the developed machine learning models, which allow the prediction of connection-blocking events. Resource use was continuously monitored and recorded during the process. Two different Convolutional Neural Network models, a 1D CNN (One-Dimensional Convolutional Neural Network) and 2D CNN (Two-Dimensional Convolutional Neural Network), are proposed as the predicting methods, and their behavior is compared to other conventional models based on an SVM (Support Vector Machine) and KNN (K Nearest Neighbors). The results obtained show that the proposed 2D CNN predicts blocking with the best accuracy (92.17%), followed by the SVM, the proposed 1D CNN, and KNN. Results suggest that 2D CNN can be helpful in blocking prediction and might contribute to increasing the efficiency of future EON networks.