In ophthalmic diagnosis, it is crucial to observe the structure of the retinal layers, and the use of Optical Coherence Tomography (OCT) is growing for this purpose. Segmentation methods for OCT images have been proposed to measure the thickness of each retinal layer. Methods for detecting the boundaries between retinal layers using U-Net, which consists of 2D CNN, 3D CNN, or a combination of both, have exhibited high segmentation accuracy. On the other hand, these methods assume that the retinal shape of the OCT image is flattened to normalize the changes in the retinal shape due to individuality and diseases. Retinal diseases and poor-quality OCT images may prevent flattening, and therefore, methods without flattening are required. To address this problem, we propose a method for detecting the boundaries between retinal layers using 1D CNN, utilizing the fact that the pixels of each retinal layer exist in the vertical direction. The proposed method employs two U-Nets consisting of 1D CNN that detects boundaries pixel by pixel and 2D CNN that considers the horizontal continuity of the boundaries. Through experiments using public datasets, we demonstrate that the proposed method can segment retinal layers more accurately than conventional methods.