TensorFlow Lite – On A Commodore 64

TensorFlow is a machine learning and AI library that has enabled so much and brought AI within the reach of most developers. But it’s fair to say that it’s not for the less powerful computers. For them there’s TensorFlow Lite, in which a model is created on a larger machine and exported to a microcontroller or similarly resource-constrained one. [Nick Bild] has probably taken this to its extreme though, by achieving this feat on a Commodore 64. Not just that, but he’s also done it using Commodore BASIC.

TensorFlow Lite works by the model being created as a C array which is then parsed and run by an interpreter on the microcontroller. This is a little beyond the capabilities of the mighty 64, so he has instead created a Python script that does the job of the interpreter and produces Commodore BASIC code that can run on the 64. The trusty Commodore was one of the more powerful home computers of its day, but we’re fairly certain that its designers never in their wildest dreams expected it to be capable of this!

If you’re interested to know more about TensorFlow Lite, we’ve covered it in the past.

Header: MOS6502, CC BY-SA 3.0.

4 thoughts on “TensorFlow Lite – On A Commodore 64

    1. I don’t think the 6502 would have been problem. Its design was used in the NES and Apple II, too.

      Personally, I think it’s amazing that the author did successfully use C64 Basic (Basic 2). Without in-line assembly code! Plain C64 Basic alone is horrid.

      With Simons’ Basic or C128 Basic (Basic v7), things would have been more practical.

  1. C64 6510 barely managed 1Mhz. Its strengths as a 8 bit micro largely came from its support chips, VIC II & SID. I don’t imagine those playing any role here. The BASIC interpreter was literally as basic as an it could be and it was very poorly coded. Combined with the sluggish 6502 variant makes this project even more impressive!

  2. It’s such a small piece of code. I think if it was compiled to assembly, then the C64 could do much more and much faster. What I’d really like to know is what the limit that the C64 could do…

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.