For traditional algorithms of autonomous obstacle avoidance in AUV navigation,there are some problems,such as low detection accuracy of obstacle areas,inaccurate obstacle recognition,and non-optimized AUV route,etc. In this paper,research on optimization technology of autonomous obstacle avoidance is carried out based on 3D imaging sonar and deep learning algorithms. The effectiveness of this algorithm is demonstrated through simulation and test in Zhanghe reservoir. The results show that the success rate and accuracy of AUV obstacle avoidance are significantly improved,and the AUV route is optimized.