Topology optimization plays an important role in a wide range of engineering applications. In this paper, we propose a novel isogeometric topology optimization algorithm based on deep learning. Unlike the other neural network-based methods, the density distributions in the design domain are represented in the B-spline space. In addition, we use relatively novel technologies, U-Net and DenseNet, to form the neural network structure. The 2D and 3D numerical experiments show that the proposed method has an accuracy rate of over 97% for the final optimization results. After training, the new approach can save time greatly for the new topology optimization compared with traditional solid isotropic material with penalization method and IGA method. The approach can also overcome the checkerboard phenomenon.