As the nonlinear and coupling characteristics of autonomous underwater vehicles (AUVs) are the challenges for motion modeling, the nonparametric identification method is proposed based on dung beetle optimization (DBO) and deep temporal convolutional networks (DTCNs). First, the improved wavelet threshold is utilized to select the optimal threshold and wavelet basis functions, and the raw model test data are denoising. Second, the bidirectional temporal convolutional networks, the bidirectional gated recurrent unit, and the attention mechanism are used to achieve the nonlinear nonparametric model of the AUV motion. And the hyperparameters are optimized by the DBO. Finally, the lazy-search-based path planning and the line-of-sight-based path following control are used for the proposed AUV model. The simulation shows that the prediction accuracy of the DBO-DTCN is better than other artificial intelligence methods and mechanical models, and the path following of AUV is feasible. The methods proposed in this paper can provide an effective strategy for AUV modeling, searching, and rescue cruising.