You should first compare python versions of the two environments. Likely your local is newer (eg Python 3.x) and incorporates a non-backwards compatible change. One fix is to use virtual environments to run locally so you can match the release level of the modules that run the code successfully (eg Python 2.x).
To add on what ai_curious mentioned, check the compatibility of the python version and the TF version. Ideally, you should be using the versions that are on Coursera.
Good advice for the entire environment, not just the several explicitly mentioned already in this thread.
However, specifically for the marshal error…
Details of the format are undocumented on purpose; it may change between Python versions (although it rarely does). 1
This is not a general “persistence” module. For general persistence and transfer of Python objects through RPC calls, see the modules pickle and shelve. The marshal module exists mainly to support reading and writing the “pseudo-compiled” code for Python modules of .pyc files. Therefore, the Python maintainers reserve the right to modify the marshal format in backward incompatible ways should the need arise.
My emphasis added
Which is why I believe Python the culprit here. Cheers