This work aims at determining the ability of a deep learning (DL) algorithm to measure retinal nerve fiber layer (RNFL) thickness from optical coherence tomography (OCT) scans in anterior ischemic optic neuropathy (NAION) and demyelinating optic neuritis (ON). The training/validation dataset included 750 RNFL OCT B-scans. Performance of our algorithm was evaluated on 194 OCT B-scans from 70 healthy eyes, 82 scans from 28 NAION eyes, and 84 scans of 29 ON eyes. Results were compared to manual segmentation as a ground-truth and to RNFL calculations from the built-in instrument software. The Dice coefficient for the test images was 0.87. The mean average RNFL thickness using our U-Net was not different from the manually segmented best estimate and OCT machine data in control and ON eyes. In NAION eyes, while the mean average RNFL thickness using our U-Net algorithm was not different from the manual segmented value, the OCT machine data were different from the manual segmented values. In NAION eyes, the MAE of the average RNFL thickness was 1.18 ± 0.69 μm and 6.65 ± 5.37 μm in the U-Net algorithm segmentation and the conventional OCT machine data, respectively (P = 0.0001).