Chest pain is a common clinical complaint for which myocardial injury is the primary concern and is associated with significant morbidity and mortality. To aid providers' decision-making, we aimed to analyze the electrocardiogram (ECG) using a deep convolutional neural network (CNN) to predict serum troponin I (TnI) from ECGs. We developed a CNN using 64,728 ECGs from 32,479 patients who underwent ECG within 2 h prior to a serum TnI laboratory result at the University of California, San Francisco (UCSF). In our primary analysis, we classified patients into groups of TnI < 0.02 or ≥ 0.02 µg/L using 12-lead ECGs. This was repeated with an alternative threshold of 1.0 µg/L and with single-lead ECG inputs. We also performed multiclass prediction for a set of serum troponin ranges. Finally, we tested the CNN in a cohort of patients selected for coronary angiography, including 3038 ECGs from 672 patients. Cohort patients were 49.0% female, 42.8% white, and 59.3% (19,283) never had a positive TnI value (≥ 0.02 µg/L). CNNs accurately predicted elevated TnI, both at a threshold of 0.02 µg/L (AUC = 0.783, 95% CI 0.780-0.786) and at a threshold of 1.0 µg/L (AUC = 0.802, 0.795-0.809). Models using single-lead ECG data achieved significantly lower accuracy, with AUCs ranging from 0.740 to 0.773 with variation by lead. Accuracy of the multi-class model was lower for intermediate TnI value-ranges. Our models performed similarly on the cohort of patients who underwent coronary angiography. Biomarker-defined myocardial injury can be predicted by CNNs from 12-lead and single-lead ECGs.