The most likely cause is that you have overlooked the very well known fact that linear voltage regulators
need headroom (additional input voltage above and beyond the output voltage to run the circuit ) so
5V-3.3V is what ? (ans: 1.7V) There is no way 1.7V is enough headroom for an LM317.
There are such things as LDO (Low Dropout regulators) but the LM317 is not one of them.
The datasheet term for headroom is "Input-Output Differential Voltage (minimum)"
If you knew what to look for you would have found it on the LM317 datasheet (http://www.ti.com/lit/ds/slvs044x/slvs044x.pdf)
on page 4 , Section 6.3 Recommended Operating Conditions:
Input-Output Differential Voltage (minimum)
the first number (3) is under the "Min
VI - VO Input-to-output differential voltage 3 40 V
That makes you 3-1.7 = 1.3V SHORT
for the LM317 input voltage.
In short, you need more input voltage for the LM317. I would think 6 to 9V.
It's just not going to work with only 5V input.
Get a 9V battery and one of these (https://www.ebay.com/i/273455231820?chn=ps&norover=1&mkevt=1&mkrid=711-117182-37290-0&mkcid=2&itemid=273455231820&targetid=503482144484&device=c&mktype=pla&googleloc=9032131&poi=&campaignid=1669934825&mkgroupid=65058350099&rlsatarget=pla-503482144484&abcId=1139296&merchantid=108057413&gclid=Cj0KCQjwy97qBRDoARIsAITONTKuIOsCpS7oWsU7i1SQ2HGiXB8UJlOsXeFE1Vw6VfZ9IABns4APwD8aAux4EALw_wcB)