In this paper, we propose a deep learning based neural network to generate three-dimensional structural topologies in an efficient way. The method consists of three steps. First, conventional three dimensional solid isotropic microstructures with penalization (SIMP) method is utilized to generate datasets consisting of various domain sizes and boundary conditions. Second, a deep learning neural network based on U-Net architecture is constructed and trained by the generated datasets. Third, by feeding new cases with different domain sizes and boundary conditions into the network, near optimal results can be directly obtained without any needs of optimization iterations and finite element analysis. Compared with conventional topology optimization methods as well as recent development of machine learning approaches, our proposed method has two advantages: (1) the design boundary conditions are directly mapped with the 3D optimized structures such that no further dependency on the conventional topology optimization algorithm is required once the model is trained, and (2) topology optimization problems with variable design domain sizes can be supported instead of requiring its size to be fixed as the input of the neural network. Experiments demonstrate that once trained, our deep learning based topology optimization method can realize near optimal three dimensional topology prediction using negligible calculation cost.