The detection and the evaluation of the shape of liver from abdominal computed tomography (CT) images are fundamental tasks in the computer-assisted liver surgery planning such as radiation therapy. However, the segmentation of the liver still remains many challenges to be solved, such as ambiguous boundaries, heterogeneous appearances and highly varied shapes of the liver. To address these difficulties, we developed an automatic liver segmentation model based on 3D U-net network. Some preprocessing steps were done to elevate the performance of our protocol first. Also, an approximate liver map was generated by calculating the gradient of CT images. The area which had high possibility to be liver was select as the training set to make sure the balance of data. Then, a deep learning U-net structure was applied for the processed training data. Finally, some post-processing methods, which include k-means clustering and morphology algorithms, was applied in our protocol. Our protocol showed the results with high structure similarity index (SSIM), dice score coefficient and peak signal-to noise ratio (PSNR) of liver segmentation model, demonstrating the potential clinical applicability of the proposed approach.