To realize highly integrated and portable spectrometer, a new type of computational spectrometer scheme has been proposed in recent years. In the existing computational spectrometers, many algorithms have been used for the inversion of the input spectra, such as principal component analysis (PCA), Tikhonov regularization inversion, compressive sensing and so on. However, A huge amount of data will probably result in a calculation failure. In order to solve the problem, this paper proposed a random pixelated grating computational spectrometer based on deep learning. The computational spectrometer uses random pixelated grating as scattering medium and records the wavelength-dependent speckle pattern. Meanwhile, the fiber spectrometer is used to record the wavelength of the incident light. Meanwhile, 6750 speckle patterns corresponding to various wavelengths are recorded in the calibration experiment. we use the PyTorch framework to build a convolutional neural network architecture of deep-learning ResNet50. We use 6600 speckle patterns as the training set. After the model is well trained by the speckle patterns, it is then used to predict the wavelengths of 150 speckle patterns. The experimental results show that the algorithm can successfully reconstruct the output spectrum of the laser diode (LD) with single longitudinal mode. the system resolution is about 0.4nm, and the correctness of wavelength prediction can be up to 95%. The experimental results show that the deep learning algorithm can be used for wavelength inversion of the computational spectrometer, and it has the advantages of high inversion speed and large data processing ability.