java icon indicating copy to clipboard operation
java copied to clipboard

Load TFJS trained model in java application.

Open cmckamey opened this issue 3 years ago • 3 comments
trafficstars

I have a model that was developed and trained in TFJS and I want to use it in my java application.

I managed to convert it to keras and then to a SavedModel but I am wondering if there is a way to just load the TFJS model directly and spare the clunky conversion process that involves several additional steps and python.

Is such a thing even possible?

cmckamey avatar Oct 12 '22 17:10 cmckamey

Looks like you should be able to go directly to a TF Saved Model with the converter, but I don't think the TFJS file format is documented so we couldn't support it.

Craigacp avatar Oct 12 '22 17:10 Craigacp

Yeah I have it working very well post conversion, just wish I could save that step. Makes implementation of my project tricky.

cmckamey avatar Oct 12 '22 17:10 cmckamey

Unfortunately not. At the moment it looks like tfjs uses something Keras-like as it's JSON format, but we don't have all the Python bits necessary to load in Keras models that aren't exported in SavedModel format.

Craigacp avatar Oct 12 '22 18:10 Craigacp