Problems installing Lineage on Moto G5 w TWRP
I installed yesterday with latest TWRP (3.2.1-0) and same lineage image as you (lineage-15.1-20180415-UNOFFICIAL-cedric.zip) and got the same error.

Try again and after failing, in TWRP go to Advanced -> Copy Log. Get the log file in your computer (adb pull /sdcard/recovery.log, you may need to change location of the log file) and open it with any editor or just cat recovery.log.

If you see a line saying:

E:Can't execute '/tmp/updater': Exec format error


Then it probably is due to having the bad TWRP. You need the 64 bits one instead of the regular one. You can get it from https://androidfilehost.com/?w=files&amp;flid=236353. Flash this new TWRP and then Lineageos and optionally gapps.

BTW I didn't need to mess with the zip image, I used the downloaded one without any modifications.